As mentioned earlier, the suffix name in Linux has no special meaning, it is generally used as the identity of different file types. The following is a description of the suffix associated with packaging and compression:
*.z:compress Program zip file
*.gz:gzip Program zip file
*.BZ2:BZIP2 Compressed Files
*.tar:tar packaged, uncompressed
*.tar.gz:tar packaged, Gzip compressed
*.tar.bz2:tar packaged, bzip2 compressed
Files that are typically packaged or compressed are distinguished by suffix names.
First, Compress: This command is older, CentOS is not installed by default, you can use gzip instead.
Ii. gzip, Zcat:zcat for reading plain text files compressed by gzip
Command format: gzip [-cdtv#] File name
Parameter description:
-C: Output compressed data to the screen
-D: decompressed parameters
-T: can be used to check the consistency of a compressed file.
-V: can display the original file/compressed file compression ratio and other information
-#: Compression level, 1 fastest, but low compression ratio, 9 slowest, but compression ratio; default is-6;
Example:
Gzip-v Man.config; <== will generate the man.config.gz file and delete the Man.config file.
Gzip-d man.config.gz; <== unzip the file and delete the man.config.gz
Gzip-9-C man.config > man.config.gz; <== Keep the original file
Zcat man.config.gz;
Third, bzip2, Bzcat:
BZIP2 offers a better compression ratio than gzip, with a specific usage similar to gzip.
Command format: bzip2 [-ckdzv#] File name
Parameter description:
-C: Outputs the data generated during the compression process to the screen.
-D: Decompression parameters
-K: Keep the original file
-Z: Compressed parameters
-V: Displays information such as the compression ratio of the original file/compressed file
-#: Consistent with gzip.
Example:
Bzip2-z Man.fig; <== man.config into man.config.bz2;
Bzcat man.config.gz2;
Bzip2-d man.config.bz2; <== Decompression
Bzip2-9-C man.config > man.config.bz2; <==