Introduction to Linux Compression

Source: Internet
Author: User

In Windows, the ultimate types of compression are. rarand. zip, but there are many comparisons in linux, such as. tar;. Zip;. GZ; .tar.gz;. bz2. Before introducing compressed files, we should first understand two concepts: Packaging and compression. Packaging refers to converting a large number of files or directories into a total file. Compression refers to compressing a large fileAlgorithmTo a small file.

Tar:

The common suffix is .tar.

Example: [V: Verbal F: file]

Tar-CVF 1.tar/mnt/zip/pack all files under/mnt/zip into a 1.tar File

Tar-zcvf 1.tar.gz/mnt/ZIP: compress all files in/mnt/zip to a 1.tar.gz file.

Tar-xzcf 1.tar.gz unzip

Bytes ---------------------------------------------------------------------------------------------------------------------------

ZIP:

Suffix: .zip

Example:

Zip 1.txt.zip 1.txt: compress 1.txtto 1.txt.zip

Unzip 1.txt.zip: compress 1.txt.zip 1.txt to 1.txt.zipt.zip.

Bytes ---------------------------------------------------------------------------------------------------------------------------

Gzip:

Suffix: .gz.

1. Only files can be compressed and directories cannot be compressed.

2. Do not retain the source file

Example:

Gzip aaa.txt: compress the aaa.txt File

Gunzip aaa.txt.gz unzip the aaa.txt.gz File

Bytes ---------------------------------------------------------------------------------------------------------------------------

Bzip:

The suffix is .bz2. The function is basically the same as that of gzip. Only files can be compressed.-KCommand to retain the original file.

Example:

Bzip2-K 111 compresses 111 files

Bunzip2 111.bz2 decompress the compressed file 111.bz2

 

 

 

 

 

 

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.