There are many Linux compression and packaging methods. The following describes the concepts of gzip and zcat commands, and lists examples of various Linux compression and packaging methods for your reference, hope to help you ....
Gzip and zcat commands
[Root @ linux ~] # Gzip [-cdt #] File Name
[Root @ linux ~] # Zcat file name .gz
Parameters:
◆-C: Output compressed data to the screen, which can be processed through data stream redirection;
◆-D: extract parameters;
◆-T: it can be used to check the consistency of a compressed file ~ Check whether the file has any errors;
◆-#: Compression level.-1 is the fastest, but the compression ratio is the worst.-9 is the slowest, but the compression ratio is the best! Default Value:-6 ~
Example 1:
Convert/etc/man. config into/tmp and compress it with gzip
[Root @ linux ~] # Cd/tmp
[Root @ linux tmp] # cp/etc/man. config.
[Root @ linux tmp] # gzip man. config
At this time, man. config will become man.config.gz!
Example 2:
Read the file content in Example 1!
[Root @ linux tmp] # zcat man.config.gz
# The man.config.gz extracted file content is displayed on the screen !!
Example 3:
Decompress the file in Example 1
[Root @ linux tmp] # gzip-d man.config.gz
Example 4: compress man. config unlocked in Example 3 with the optimal compression ratio and keep the original file
[Root @ linux tmp] # gzip-9-c man. config> man.config.gz
The above is the gzip and zcat commands in the Linux compression and packaging method. The following describes the bzip2 and bzcat commands.
- Linux compression and packaging method 1)
- How to monitor the usage of Linux system resources
- Do you know Linux file extensions?
- Debian edition for the Linux release
- Multiple Linux compression methods