1. Tar is just a packaging command and does not compress
Example: TAR-CVF tmp.tar/tmp
-C: On behalf of packaging
-V: Represents the display packaging process
-F: Represents the specified package file name
-X: Delegate Unpacking
2. Compression options
-Z: Identify. gz format
-j: Identify. bz2 format
Example: TAR-ZCVF tmp.tar.gz/tmp the/tmp directory is compressed and packaged
TAR-JCVF tmp.tar.bz2
3. View only the puzzle package
-T: represents only the contents of the compressed package, does not unpack and decompress
Example: TAR-ZTVF tmp.tar.gz
TAR-JTVF tmp.tar.bz2
4. Specify the location of the uncompressed file
Example: TAR-JXVF root.tar.bz2-c/tmp/
5. Other recognized compression formats. zip,. gz,. bz2
Command: Zip (can compress directory)
Zip-r tmp.zip/tmp
Zip Aaa.zip AAA
Decompression: Unzip Aaa.zip
Command: gzip (cannot compress directory, only content in directory)
Do not keep source files: gzip AAA
Keep source files: Gzip-c AAA > aaa.gz
Compression directory: GZIP-R/tmp
Decompression: Gunzip or gzip-d
Command: bzip2 (cannot compress directory)
Source files are not preserved: bzip2 AAA
Keep source file: Bzip2-k AAA
Decompression: gzip-d
This article from "ZYZDBK" blog, declined reprint!
Linux command tar, etc.