Compress folder in tar.gz format using the terminal in Linux. Add current date to filename
ID: 380
Category: Linux Terminal
Added: 3rd of November 2024
Views: 141
To compress a folder in tar.gz format and also add the date in UK format to the file name, enter the following command.
tar -zcvf "backup_folder_name-$(date +"%d-%m-%Y").tar.gz" backup_folder_name
To add the date in US format to the file name, enter the following command.
tar -zcvf "backup_folder_name-$(date +"%m-%d-%Y").tar.gz" backup_folder_name
%d=date
%m=month
%Y=year
Related Tips & Tutorials
➔ Compress folder in zip format using the terminal in Linux. Add current date to filename