1. Command: gzip (zip file)
Zip file suffix. gz
Ps:gzip test.txt Result: Generate file test.txt.gz, original file test.txt disappear.
Note: Only files can be compressed, the directory cannot be compressed, the original files are not preserved after compression, about 1/5 compression ratio
Decompression command: Gunzip
2. Command: Tar (packed compressed directory) strictly speaking, this command is the "pack and Go" command, which packages the directory into a *.tar file
Syntax: TAR option compressed after file name directory
Zip file suffix: *.tar.gz
Option: [-ZCVF]-C package
-V Show More information
-F specified after file name
-Z Package simultaneous compression
PS: #mkdir Japan build Japan Catalogue
#tar-ZCVF Japan.tar.gz Japan generate Japan.tar.gz Compressed files
Unzip command: Tar [options] compress file. tar.gz
[-ZXVF]-X unpacking
-V Show More information
-F specified after file name
-Z Decompression
PS:TAR-ZXVF Japan.tat.gz
3. Command: Zip (compressed file or directory)
Compressed file suffix:*. zip
Syntax: Zip [options] After compressing file name file or directory
-R Compression Directory
PS: #zip-R japan.zip Japan compression catalog Japan, generate Japan.zip file.
#zip test.txt.zip test.txt Compressed file test.txt, generate Test.txt.zip file, keep original file
Decompression command: Unzip file name
Note: After compressing the original file, the compression ratio is less than gzip.
4. Command: BZIP2 (gzip upgrade, compression ratio amazing)
Zip file suffix: *.bz2
Syntax: bzip2 [options] File
-K retains original file after compression
Ps:bzip2-k test.txt generates test.txt.bz2 file, the original file Test.txt reserved.
Packaged compressed TAR-CJVF package compressed file name directory
Unpacking and extracting TAR-XJVF files
-
linux-Compression Decompression Command (GZIP,ZIP,TAR,BZIP)