Common compression commands for Linux systems
1 Common compressed file extensions *.tar, *.tar.gz, *.tgz, *.gz, *. Z, *.bz2
*. Z Compress program compressed files, obsolete;
*.gz gzip program compressed files;
*.BZ2 bzip2 program compressed files;
*.tar the TAR program to package the data, and has not been compressed;
*.tar.gz tar program packaged files, which are also compressed by gzip
*.TAR.BZ2 tar program packaged files, which are bzip2 compressed
2 gzip [-cdtv#] File
-C: Output compressed data to the screen, can be processed through data flow redirection;
-D: the extracted parameters;
-T: can be used to verify the consistency of a compressed file ~ See if there are errors;
-V: can display the original file/compressed file compression ratio and other information;
-#: Compression level, 1 the fastest, but the worst compression, 9 slowest, but the best compression! Default is-6
Example: Gzip-v pafa.log compression
gzip-d pafa.log.gz Decompression
Gzip-c pafa.log > pafa.log.gz Compress and keep the original file
Zcat file. gz
Example: Zcat pafa.log.gz Read Compressed file contents
bzip2 [-cdkzv#] File
-C: Output the data generated by the compression process to the screen!
-D: decompressed parameters
-K: retains the original file without deleting the original file Oh!
-Z: Compressed parameters
-V: can display the original file/compressed file compression ratio and other information;
-#: Same as gzip, all in the calculation of compression ratio parameters,-9 best,-1 fastest! 6, yes.
Example: Bzip2-z pafa.log compression
bzip2-d pafa.log.bz2 Decompression
Bzcat file. gz
Example: Bzcat pafa.log.bz2 Read Compressed file contents
3 tar [-j|-z] [CV] [-F created file name] FileName
-C: Create a packaged file that can be paired with-V to see the file name (filename) that is packaged in the process
-T: Look at the contents of the package file contains which file name, focus on the "file name" is;
-X: Unpack or unzip the function, can be used with-C (uppercase) in a specific directory to unlock
It is particularly noted that the-C,-T,-X cannot appear in a sequence of command columns at the same time.
-J: Compression/Decompression via BZIP2 support: The file name is preferably *.tar.bz2
-Z: Compression/decompression via GZIP support: This is the best name for *.tar.gz
-V: During the compression/decompression process, the file name being processed is displayed!
-F filename:-f to be processed immediately after the file name! Recommended-F Write an option for separate ROM!
This article is from the "Westerly poplar" blog, please be sure to keep this source http://jianliang.blog.51cto.com/2562396/1790976
Common compression packaging commands for Linux systems