Reference to "Brother Bird's Linux private dishes"
1. Compression commands
Gzip (compress) and zcat (unzip and read out)
Gzip can be said to be the most widely used compression command! Currently gzip can unlock files that are compressed by compress, zip and gzip software.
[[email protected] ~]# gzip [-cdtv#] File name [[email protected] ~]# zcat file name. Gz options and Parameters:-C: Output compressed data to the screen, can be processed by data flow redirection;-D: the extracted parameters;-T : Can be used to verify the consistency of a compressed file ~ To 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 compression ratio is the worst, 9 slowest, but the best compression! The default is -6 example one: Copy/etc/man.config to/tmp and compress with gzip [[email protected] ~]# cd/tmp [[email protected] tmp]# cp/etc/man.config. [ [email protected] tmp]# gzip-v man.configman.config:56.1%--Replaced with man.config.gz
Zcat man.config.gz# because man.config this original file is a text file, so we can try to use Zcat to read! # At this point the screen will show the contents of the file after man.config.gz decompression! gzip-d man.config.gz# Don't use gunzip this command, bad back! Use gzip-d to decompress! # In contrast to gzip, gzip-d will delete the original. GZ and produce the original Man.config file.
BZIP2, Bzcat
The bzip2 is intended to replace Gzip and provide a better compression ratio. Bzip2 is a really nice thing to use ~ this thing is better than the compression ratio of gzip ~ ~ BZIP2 use almost the same as Gzip
[Email protected] ~]#bzip2 [-cdkzv#] File name [[email protected] ~]#bzcat file name. bz2 Options and Parameters:-C: Outputs the data generated by the compression process to the screen! -D: decompressed parameter-K: preserves the original file without deleting the original file Oh! -Z: Compression parameter-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! Example One: Compress the/tmp/man.config with bzip2 [[email protected] tmp]# bzip2-z man.config # At this point Man.config will become man.config . bz2! Example Two: Read the file contents of sample one! [[email protected] tmp]# bzcat man.config.bz2# The contents of the file after man.config.bz2 decompression will be displayed on the screen!! example Three: Unzip the file of sample one [[email protected] tmp]# bzip2-d man.config.bz2 example four: Man.config with the example three is compressed with the best compression ratio and retains the original file [ [Email protected] tmp]# bzip2-9-C man.config > man.config.bz2
2. Packaging Command Tar
Pending completion,,,
linux03--File Packaging and decompression