GZ, bz2, XZ, ZIP, format compression commands and tar usage on Linux operating systems

Source: Internet
Author: User
Tags bz2

Compression ratios are different for each compression algorithm

GZIP: Compressed files are. gz format, so is the suffix

Gzip/path/to/somefile: The original file is deleted when the compression is complete, the compressed file is named after the source file, and the suffix is added automatically

Gunzip: Unzip files in. gz format and delete original files after decompression

Zcat: To view the contents of a text file without pressure. gz files


------------------------------------------------------------------

BZIP2: Compressed file is in. bz2 format, suffix is also true

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

Bzip2/path/to/somefile after compression is complete, the original file is deleted, the compressed file is named after the source file, and the suffix is added automatically

-K: Keep the original file when compressing

BUNZIP2: Unzip the. bz2 formatted file and delete the original file after decompression

Bzcat: Without pressure. bz2 file, view the contents of the text file


------------------------------------------------------------------

XZ: The compressed file is in. xz format, and the suffix is also

Xz/path/to/somefile after compression is complete, the original file is deleted, the compressed file is named after the source file, and the suffix is added automatically

-K: Keep the original file when compressing

UNXZ: Unzip the. xz format file and delete the original file after decompression


-------------------------------------------------------------------

Zip: Compressed file is in. zip format, suffix is also true

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

Unzip: Extract files in filename.zip format

-d specifies decompression to the specified path

-L View Compressed file contents, but not uncompressed

--------------------------------------------------------------------

Tar: Archive tool with a file suffix of. tar

Tar zcvf FILE.tar.gz FILE1

Common options:

-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: Archive and call bzip2 compression

-JXF: Call bzip2 to unzip and expand archive


-JCF: Archive and invoke XZ compression

-JXF: Call XZ to unzip and expand archive



This article is from the "Burning Brain" blog, so be sure to keep this source http://rsddn.blog.51cto.com/10840178/1828630

GZ, bz2, XZ, ZIP, format compression commands and tar usage on Linux operating systems

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.