In Windows, the ultimate types of compression are. rarand. zip, but there are many comparisons in linux, such as. tar;. Zip;. GZ; .tar.gz;. bz2. Before introducing compressed files, we should first understand two concepts: Packaging and compression. Packaging refers to converting a large number of files or directories into a total file. Compression refers to compressing a large fileAlgorithmTo a small file.
Tar:
The common suffix is .tar.
Example: [V: Verbal F: file]
Tar-CVF 1.tar/mnt/zip/pack all files under/mnt/zip into a 1.tar File
Tar-zcvf 1.tar.gz/mnt/ZIP: compress all files in/mnt/zip to a 1.tar.gz file.
Tar-xzcf 1.tar.gz unzip
Bytes ---------------------------------------------------------------------------------------------------------------------------
ZIP:
Suffix: .zip
Example:
Zip 1.txt.zip 1.txt: compress 1.txtto 1.txt.zip
Unzip 1.txt.zip: compress 1.txt.zip 1.txt to 1.txt.zipt.zip.
Bytes ---------------------------------------------------------------------------------------------------------------------------
Gzip:
Suffix: .gz.
1. Only files can be compressed and directories cannot be compressed.
2. Do not retain the source file
Example:
Gzip aaa.txt: compress the aaa.txt File
Gunzip aaa.txt.gz unzip the aaa.txt.gz File
Bytes ---------------------------------------------------------------------------------------------------------------------------
Bzip:
The suffix is .bz2. The function is basically the same as that of gzip. Only files can be compressed.-KCommand to retain the original file.
Example:
Bzip2-K 111 compresses 111 files
Bunzip2 111.bz2 decompress the compressed file 111.bz2