One, Linux under the common compression instructions
In the Linux environment, Most of the extensions for compressed files are: [*.tar,*.tar.gz,*.tgz,*.gz,*. Z,*.BZ2], Why do you have this extension? Doesn't it mean that the extension under Linux doesn't work?
This is because Linux supports a very high number of compression instructions, and the different instructions used by the compression technology is not the same, of course, you may not be able to exchange compressed/uncompressed files. So, when you download to a compressed file, you naturally need to know what kind of compression instructions the file is compressed, good for compression! That is, although the properties of a Linux file are basically not strictly related to the file name, the appropriate extension is necessary to help with the memory. Below we will list a few common zip file extension.
*. Z Compress program compressed files;
*.gz gzip program compressed files;
*.BZ2 bzip2 program compressed files;
*.tar the data packaged by the TAR program, but not compressed;
*.tar.gz Tar program packed data, and gzip compressed;
*.TAR.BZ2 the TAR program to package the data, and after bzip2 compression;
The usual compression instructions on LINXU are gzip and bzip2,compress have exited popular.
This tar can "pack" vigilance multiple files into a file! Even the catalogue can play this way. However, the pure tar function is only "packaged", that is, a lot of files are assembled into a file, in fact, he did not provide compression capabilities, and later, the GNU program, the entire tar and compressed functionality together, so as to provide users more convenient and more powerful compression and packaging features! Let's talk about these basic compression commands underneath Linux!
1.comprss
have been out of fashion.
2.gzip and Zcat
gzip can be said to be the most widely used compression instructions! Currently gzip can unlock files compressed by compress, zip and gzip software . As for gzip, the file name of the *.gz is created by the zip files. Let's take a look at the usage of this instruction:
Similar to compress, when you compress using gzip, the original file is compressed into a. GZ filename, and the source files no longer exist. You can also find that gzip compression ratio is much better than compress, so of course it is recommended to use gzip! In addition, the use of gzip compressed files in the Windows system, unexpectedly can be WinRAR this software to decompress it! Very good! The other uses are as follows:
In fact, gzip compression has been optimized, so although Gzip provides 1~9 compression level, using the default 6 is very useful! So the above example four can not join that-9 of the election. Example four focuses on the use of the-C and >!
Cat can read the plain text file, the Zcat can read the compressed file of plain text files! because gzip this compression instruction mainly wants to replace compress, so not only compress compressed file case can use gzip to untie , while zcat this instruction can simultaneously read compress and gzip compressed file Yo!
3.bzip2
4.tar
Compression and packaging of Linux system files and file systems