First of all to say what is archiving and archiving, everyone under windows are ARJ WINZIP or RAR, such as software to package the software process compression, the same Linux inside also have similar software their suffix name is *.tar *.gz
*.tar.gz bz2 *.z. BZ2 is a software compression package that is more powerful than compression. Now let's take a look at these commands.
1.compress compressed files are appended to the original file with the extension. Z. If you do not specify that it is in accordance with standard output.
-R recursive operation
-C Returns the compressed data to the standard output, and the compressed data is returned to the file by default when the file is compressed.
-V Displays the percent of compression per file
Example: Compress/mnt/hack.doc
LS results show the file as Hack.doc.z
The extracted command is ucompress/mnt/hack.doc.z.
The results of the decompression display are: Ucompress/mnt/hack.doc
This command is not commonly used, the compression is also relatively poor so we simply mentioned on the line, as an understanding.
2.gzip compressed files using Lempel-ziv encoding
Command options
-C compression results to the standard output, the original file remains unchanged by default, gzip compresses the original file to a. gz file. and delete the original file.
-V Output Processing information
-D unzip the specified file
-T test the integrity of compressed files
Gzip is more efficient than compress compression
Gzip-v/mnt/hack.doc
The compression result is hack.doc.gz
The uncompressed command is: gunzip/mnt/hack.doc.gz ' extract to the current directory
The result of decompression is: Hack.doc
3 tar command package backup to destination directory
-C Create new archive
-R to extract file from archive
-X extract file from archive
-o remove file to standard output
-V processing Process output related information
-F to General Action
-Z invokes gzip to compress the archive, call gzip complete compression when-X, and call compress to compress the archive, and call Compress when X-union completes the compression
Package Command Demo tar
TAR-CVF/ Mnt/hack.doc.tar/mnt/hack.doc
Result output is: Hack.doc.tar
extract Command Tar-xvf/mnt/hack.doc.tar
Output: Hack.doc
It is generally better to use the TAR command and the gzip command together to package the effect. The
command demonstrates the following:
Tar-cvf/mnt/hack.doc
Gzip/mnt/hack.doc.tar
Output is: hack.doc.tar.gz
Extract This type of package when the command is as follows
gunzip/mnt/hack.doc.tar.gz
tar -xvf/mnt/hack.doc.tar
Output is: Hack.doc