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

Popular posts from this blog

BdsDex: failed to load Boot0001 "UEFI BHYVE SATA DISK BHYVE-OABE-20A5-E582" from PciRoot(0x0)/Pci (0x2, 0x0)/Stat(0x0,0xFFFF,0x0) : Not Found

How To Install Nginx, MySQL and PHP (FEMP) Stack on FreeBSD 13.0

Install samba on FreeBSD(on VMware Workstation) to share files with Window.