[Linux] Common compression commands

Source: Internet
Author: User
Gzip adopts the file extension gz compressed by gzip. Its syntax is as follows: gzip [-cdtv] filename-c: Compress-d: decompress-t: check file consistency-v: display compression ratio and other messages-: compression level, value range: 1 ~ 9, 9 of which has the highest compression rate. the default value is 6. the extension name of the file using g gzipw.gzipcompressed is .gz. Its syntax is as follows:
Gzip [-cdtv #] filename-c: Compression-d: extract-t: check file consistency-v: Display compression ratio and other messages-#: compression level, value range: 1 ~ 9, 9 of which has the highest compression ratio. the default value is 6.
Note when using gzip: by default, the original file will no longer exist, so be careful. to retain the original file, perform the following operations:
Gzip-c man. config> man.config.gz
Another point: the default compression ratio of 6 is good enough, and it is not recommended to modify it. The usage is almost the same as that of gzip. The compression command mentioned earlier in tar can only compress a single file and cannot compress this directory. the tar command can package and compress the entire directory, and its syntax is very complex, however, the most common commands are as follows:
Compression: files or directories to be compressed by tar-zcvf filename.tar.gz-files or directories to be compressed by gzip-files or directories to be compressed by jcvf filename.tar.gz 2-compressed by bzip2 query: tar-ztvf filename.tar.gz tar-jtvf filename.tar.gz 2 decompress: tar-zxvf filename.tar.gz directory tar-jxvf filename.tar.gz 2 to be decompressed

Related Article

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.