Packing Instruction tar
tar [-z|-j|-J] [-c|-t|-x] -v [-f new_filename] filename.
-c Create a new archive containing the specified items.
-t List archive contents to stdout. The long option form is --list.
-x Extract to disk from the archive.
-f file, --file file
Read the archive from or write the archive to the specified file.
-J, --xz
(c mode only) Compress the resulting archive with xz(1).
-j, --bzip, --bzip2, --bunzip2
(c mode only) Compress the resulting archive with bzip2(1).
-z, --gunzip, --gzip
(c mode only) Compress the resulting archive with gzip(1).
-k, --keep-old-files
(x mode only) Do not overwrite existing files.
-v, --verbose
Produce verbose output.
Others
-p, --insecure, --preserve-permissions
(x mode only) Preserve file permissions.
-P, --absolute-paths
Preserve pathnames.
--exclude pattern
Do not process files or directories that match the specified pattern.
More details man tar.
Demo
Pack and compress the time it takes to calculate them at the same time:
# time tar -zpcv -f /root/etc.tar.gz /etc
# time tar -jpcv -f /root/etc.tar.bz2 /etc
# time tar -Jpcv -f /root/etc.tar.xz /etc
Comments
Post a Comment