Up to $140 off-Lowest  Prices of 2024(Nov.21-Dec.2)

My Computer Tips

Home | About | Categories | All Tips & Tutorials

Compress folder in zip format using the terminal in Linux. Add current date to filename

ID: 381

Category: Linux Terminal

Added: 8th of November 2024

Views: 116



Click here to buy Linux books on Amazon
Affiliate Link ⓘ


To compress a folder in zip format and also add the date in UK format to the file name, enter the following command.
zip -r "backup_folder_name-$(date +"%d-%m-%Y")" backup_folder_name

To add the date in US format to the file name, enter the following command.
zip -r "backup_folder_name-$(date +"%m-%d-%Y")" backup_folder_name

%d=date
%m=month
%Y=year

Related Tips & Tutorials

Compress folder in tar.gz format using the terminal in Linux. Add current date to filename