Linux Learning Compression Decompression command

Source: Internet
Author: User

Commonly used are 4 groups: GIZP, tar, zip, bzip2, listed below:


1. Compression command gzip

Can only be used to compress files, not to compress directories.

The original file will not be retained after compression.


2, decompression command gunzip

Another equivalence method is gzip-d [gz compressed file]


3. Packing Compression Command tar

Can be used to package compressed files or to package compressed directories.

The original file or directory is preserved after packaging is compressed.

It is not compressed until the parameter z is added, otherwise it is only packaged.

Example of packing a compressed directory: TAR-ZCF myfirst.tar.gz mydir/


4. Unpack and unzip the command tar

Compared to packing compression with the tar command, the difference between parameters is: packing with parameter C, unpacking parameters X


5. Compress command zip

Can be used to compress files, you can also compress the directory, you need to add parameters when compressing the directory R

The original file or directory is preserved after compression.


6. Decompression Command Unzip


7, Compression command bzip2

Can only be used to compress files.

This is an upgrade version of the gzip command, compared to zip compression, its compression ratio is more significant, generally used to compress large files, and can be set to save the original file.

The parameter k is used to indicate the retention of the original file, and Gzip never retains the original file. K denotes keep.

Can be used in conjunction with the tar command, TAR-CJF xxx.tar.bz2 mydir/indicates that the directory Mydir packed into bz2 format files. Note that this is J, not Z.


8. Decompression Command BUNZIP2

Can be used in conjunction with the tar command, TAR-XJF xxx.tar.bz2 mydir/represents the uncompressed file xxx.tar.bz2. Note that this is J, not Z.


Linux Learning Compression Decompression command

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.