Linux Archiving and solution archiving __linux

Source: Internet
Author: User
Tags bz2 gz file
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.