Recently learning to use Linux, feel that compression commands are frequently used commands, so it took a little time to summarize the following, in case of normal use later, for the flip.
One of the most used compression commands in "gzip" Linux.
Command using: gzip "-cdtv#" file name
Parameters:
-C: Output compressed data to the screen, or through data flow redirection to handle
-D: Unzip the parameter to delete the original. gz file
-T: Used to verify the consistency of a compressed file to see if the file is error-free
-V: can show the source file/compressed file compression ratio and other information
-#: Compression level, #为1-9 of the number, 9 compression ratio is the highest, but the compression is slow, 1 compression is the smallest, the fastest compression, the default-6 "bzip2" using the method and gzip very similar, compared to GZIP,BZIP2 compression is better.
Command using: bzip2 "-cdktv#" file name
Parameters:
-C: Output compressed data to the screen, or through data flow redirection to handle
-D: Unzip the parameter to delete the original. gz file
-K: Preserves source files and does not delete original files
-T: Used to verify the consistency of a compressed file to see if the file is error-free
-V: can show the source file/compressed file compression ratio and other information
-#: Compression level, #为1-9 number, 9 compression ratio is highest, but compression is slow, 1 compression ratio is minimal, compression is the fastest, default-6
The Tar tar command is very high in Linux, and *.tar.gz or *.tar.bz2 files have to use the tar command.
Parameters:
-C: New package file, often with-V with the file name that is packaged during the viewing process
-C directory: Unzip into the development directory
-F filename:-f followed by the file name being processed
-J: Compression/decompression via bzip2, the file name is preferably *.tar.bz2
-Z: Compression/decompression via GZIP2, the file name is preferably *.tar.gz
-T: View what file names are included in the contents of a packaged file
-V: During compression/decompression, the file being processed is displayed
-X: Unzip
In fact, the most common command of tar is the following 3 forms just remember that the following 3 form is OK:
1. Compression: tar-jcv-f filename.tar.bz2 files or directories to be compressed
2, inquiry: Tar-jtv-f filename.tar.bz2
3, Decompression: Tar-jxv-f filename.tar.bz2-c to extract the directory
Summary of compression command usage in Linux