gzip [file]
Compressed file format. GZ, this command only compresses files and cannot compress the directory. And this command does not retain the source file after compression
gunzip [file] or gzip-d [file]
Unzip the. Gz zip file
tar [-ZCVF] [file name after compression] [directory]
Package Directory
Compressed file format. tar.gz
-C Packaging
-X Decompression
-V Show More information
-F Specify File name
-Z Package simultaneous compression
tar [-ZXVF] [unzip file name] [directory]
Zip [file name after compression] [files]: Compressed file, This command does not have gzip compression ratio high
[-R] [file name after compression] [contents]: Compressed directory
Compressed file format. zip
Note: If you compress the directory without the-R, then the compressed file only has the root directory file name, and no subdirectories and contents
bzip2 [-K] [compressed file] Compression ratio highest
-K to preserve source files after compression
Example of working with tar: TAR-CJF testfile.tar.bz2 testfile, change Z to F, Note that after f you should immediately pick up the file or directory name, do not add parameters, or it will be an error, such as TAR-CFJ TESTFILE.TAR.BZ2 testfile is wrong.
BUNZIP2 [-K] [compressed file]
-K to preserve source files after compression
Example of working with tar: TAR-XJF testfile.tar.bz2, change Z to F, Note that after f you should immediately pick up the file or directory name, do not add parameters, otherwise it will be an error, such as TAR-CFJ testfile.tar.bz2 Testfile is wrong.
Linux common Commands-Compression decompression commands