Compression decompression command on Linux

Source: Internet
Author: User

1, Gzip/gunzip/zcat

gzip [OPTION] ... FILE ...

-D: Decompression, equivalent to Gunzip;

-#: Specify the compression ratio, the default is 6; the larger the number, the greater the compression ratio (1-9);

-C: Output the compression result to standard output;

Gzip-c FILE >/path/to/somefile.gz

2, Bzip2/bunzip2/bzcat

bzip2 [OPTION] ... FILE ...

-D: Unzip

-#: Specify the compression ratio; the default is 6; the higher the number, the greater the compression ratio (1-9);

-k:keep, keep the original documents;

3, Xz/unxz/xzcat

XZ [OPTION] ... FILE ...

-D: Unzip

-#: Specify the compression ratio; the default is 6; the higher the number, the greater the compression ratio (1-9);

-K: Keep the original file;

4. Tar command: Archive, equivalent to packaging

tar [OPTION] ... FILE ...

(1) Create an archive

-c-f/path/to/somefile.tar FILE ...

-cf/path/to/somefile.tar FILE ...

(2) Expand archive

-xf/path/from/somefile.tar

-xf/path/from/somefile.tar-c/path/to/somedir

(3) View file list of archived files

-tf/path/to/somefile.tar

After the completion of the archive usually need to compress, the result of the previous compression tool, can be implemented to compress multiple files;

(4) Archive compression

-z:gzip2

-zcf/path/to/somefile.tar.gz FILE ...

Unzip and expand Archive:-zxf/path/to/somefile.tar.gz

-j:bzip2

-jcf

-jxf

-j:xz

-jcf

-jxf

Zip:

Zip/unzip

Suffix name:. zip



This article is from the "Wang Liming" blog, make sure to keep this source http://afterdawn.blog.51cto.com/7503144/1864283

Compression decompression command on Linux

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.