Siege Lion on the Way (iii) Linux (27)---Compression and packaging common compression commands

Source: Internet
Author: User
Tags gz file

As mentioned earlier, the suffix name in Linux has no special meaning, it is generally used as the identity of different file types. The following is a description of the suffix associated with packaging and compression:

*.z:compress Program zip file

*.gz:gzip Program zip file

*.BZ2:BZIP2 Compressed Files

*.tar:tar packaged, uncompressed

*.tar.gz:tar packaged, Gzip compressed

*.tar.bz2:tar packaged, bzip2 compressed

Files that are typically packaged or compressed are distinguished by suffix names.

First, Compress: This command is older, CentOS is not installed by default, you can use gzip instead.

Ii. gzip, Zcat:zcat for reading plain text files compressed by gzip

Command format: gzip [-cdtv#] File name

Parameter description:

-C: Output compressed data to the screen

-D: decompressed parameters

-T: can be used to check the consistency of a compressed file.

-V: can display the original file/compressed file compression ratio and other information

-#: Compression level, 1 fastest, but low compression ratio, 9 slowest, but compression ratio; default is-6;

Example:

Gzip-v Man.config; <== will generate the man.config.gz file and delete the Man.config file.

Gzip-d man.config.gz; <== unzip the file and delete the man.config.gz

Gzip-9-C man.config > man.config.gz; <== Keep the original file

Zcat man.config.gz;

Third, bzip2, Bzcat:

BZIP2 offers a better compression ratio than gzip, with a specific usage similar to gzip.

Command format: bzip2 [-ckdzv#] File name

Parameter description:

-C: Outputs the data generated during the compression process to the screen.

-D: Decompression parameters

-K: Keep the original file

-Z: Compressed parameters

-V: Displays information such as the compression ratio of the original file/compressed file

-#: Consistent with gzip.

Example:

Bzip2-z Man.fig; <== man.config into man.config.bz2;

Bzcat man.config.gz2;

Bzip2-d man.config.bz2; <== Decompression

Bzip2-9-C man.config > man.config.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.