Example | Explanation / Remarks |
tar -czvf /home/user/dest_backup.tgz /var/www/source_dir/*.html | c=create z=use gzip v=verbose f=next param is target file. Compress all files in source directory into the specified dest file |
tar -xzvf /home/user/backup_file.tgz /var/www/dest_dir/*.html | extract files in source file into the specified dest directory(??) |
Using find: |
find /var/log -iname '2022-06*.log' -print0 | tar -cvf /var/bu/june.tar –null -T - |
find . -type f > list_of_files.txt && tar -czf bu_file.tar.gz -T list_of_files.txt |
find . -type f -exec tar -czf {}.tar.gz {} \; | !← TODO! |