Compression under Llinux and compression on windows are basically the same, some files are easy to transfer, and some files are compressed when backed up because they only occupy a small amount of resources ....
And most of the virus is very difficult to infect compressed files ...
Gzip: Mainly in order to compress the files, gzip but not compress the directory, using the hair as shown below:
This will be able to suppress the file into a compressed package, and such a big treasure way can also be reduced by 5 of the original file space Oh, a bit of amazing compression ratio ....
The compressed command is gzip, then the extracted command is also very easy, just add a more UN in front of the zip, gunzip or gzip-d to unzip the file name. As shown below:
Note is the use of gzip decompression and decompression with Gunzip when he is not saving the source files ...
For example, in the case of a directory, then we can compress her with the tar command:
Tar in fact, when using the option parameters are generally used only to-CVF this general problem is not big, of course, if you do not add-V is also possible, but there is no packaging information process, as follows ...
This way he can pack the success, and he will return the packaging information inside, and here can also be a new compressed file again for another gzip compression, because the ratio of space can be reduced.
With this compression, we can find that the compressed space is a little intimidating, as shown below:
This is divided into first packaging, then compression, so the feeling may be a bit troublesome, in fact, he can be synchronized, as follows:
Just add one more option parameter Z so you can easily add pleasant to complete the packaging compression operation .....
. tar.gz this is the most common installation package on the Web, basically. tar.gz.
Packing all the constant, then we will start unpacking ...
This is basically the same as packaging, but the option of-C changed to-X, as follows:
The above option parameter inside the-V is actually can be removed, so that he did not decompress the effect of the parameters returned ....
Zip: Compress unzip command
. zip is the only compression method supported under Linux and Windows ...
However, the pure version of Linux may need to be loaded with one more zip, as shown below:
But it's very rare, just load it up, and then compress it a bit:
This way he can be compressed, and his source files will be automatically preserved oh, but his compression ratio is certainly not gzip so good, under Linux is not so much ...
If you are compressing a file, you only need to add one more option-r so you can ...
Zip Decompression:
But to install a unzip first, install it directly with Yum:
After installation, enter unzip Leigood.zip as follows:
has successfully extracted the ...
Bzip2, he is also an upgraded version of Zip 、、、
Bzip2 compression ratio is very amazing, if it is a large file, it is strongly recommended to use bzip2 to compress ...
The above-K is to save the original file ...
bzip2 file packaging, in fact, this is also very easy, just add-CJF on the options can be as follows:
If it is decompressed it is also very easy, as shown below:
BZIP2 file decompression can be extracted using BUNZIP2,-K is to be able to save the source file ...
BZ2 Directory decompression is also possible to use the TAR-XJF directory name. tar.bz2 for decompression, as follows:
Summary:
. GZ compression: gzip uncompressed: Gunzip (or: gzip-d)
. Tar compression: TAR-CF (package only, not all), unzip:-XF
Most commonly used:
. tar.gz compression: TAR-ZCF decompression: ZXF
Zip can compress files or directories compressed files: Zip to compress files: Zip-r extract: Unzip
. BZ2 compression: bzip2 uncompressed: BUNZIP2
. tar.bz2 (This is for directory use) compression: TAR-CJF decompression: TAR-XJF
TarC:Create a compressed archive-x: Unzip-T: View content-r: Append files to the end of the compressed archive file-u: Update the files in the original package the above five are independent command parameters, compressed decompression to use one, can be used with other commands but only one of them. The following parameters are optional when compressing or extracting files as needed. -Z: GZ with gzip properties-J: bz2 with bz2 properties-J: XZ with XZ properties-Z: With the Compress attribute-V: Show All procedures-O: Unpack the file to the parameters below the standard output-F is a must.-F: Use the file name, remember that this parameter is the last parameter, can only be followed by the file name.
Kill Thunder Dog---Compression and decompression under Linux no:25 Linux