Linux commands: Compression and decompression

Source: Internet
Author: User

Compression, decompression command, different algorithm, compression ratio will also be different

Compression format: GZ, bz2, XZ, zip, Z

==================================================

gzip:. GZ

Gzip/path/to/somefile: The original file is deleted when the compression is complete

-D:

-#:1-9, specify the compression ratio, default is 6;

g un Zip:

Gunzip/path/to/somefile.gz: The original file will be deleted when the decompression is complete

Zcat/path/to/somefile.gz: To view the contents of a text file without being pressed


==================================================

BZIP2:. bz2

Compression tool with a greater compression ratio than gzip, using a format approximation

Bzip2/path/to/somefile

-D

-#: 1-9, default is 6

-K: Keep the original file when compressing

bunzip2/path/to/somefile.bz2

Bzcat


==================================================

XZ:. XZ

Xz/path/to/somefile

-D

-#: 1-9, default is 6

-K: Keep the original file when compressing

Unxz

Xzdec

Xzcat

installation package download Link: xz-5.2.2.tar.bz2 (1165 KiB)


==================================================

Zip: Both archived and compressed tools

Zip Filename.zip FILE1 FILE2 ...: Do not delete the original file after compression

Unzipfilename.zip

Archive: Archiving, archiving by itself does not imply compression

XZ, bz2, GZ

==================================================

Tar: Archive tool,. Tar

-C: Create an archive file

-F File.tar: Archived files for operations

-X: Expand Archive

--xattrs: Preserves extended attribute information for files when archiving

-T: Do not expand the archive to directly see which files are archived

-ZCF: Archive and invoke gzip compression

-ZXF: Call gzip to unzip and expand Archive,-Z option to omit

-jcf:bzip2

-JXF:

-jcf:xz

-JXF:

==================================================

Cpio: Archive Tool


Linux commands: Compression and decompression

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.