Linux_ file compression and archiving

Source: Internet
Author: User

Compression and decompression:
Compression format: gz,bz2,xz,zip,z

Compression algorithm: Compression algorithm is different, compression ratio will be different, the compression algorithm is not discussed here

Compression and decompression of files
Gzip: *.gz
Gzip/path/file_name: The original file is deleted when the compression is complete
-D: Unzip
-#: Compression ratio (1-9), default = 6

Gunzip: ==> gzip-d
gunzip/path/file_name.gz: Delete original file after decompression

Zcat/path/file_name.gz: View the contents of a compressed text file without being pressed

BZIP2: *.bz2
Greater compression ratio than gzip
-D: Unzip
-#: Compression ratio 1-9, default 6
-K: Keep the original file when compressing

BUNZIP2: Decompression


XZ: *.xz
-D: Unzip
-#: Compression ratio 1-9 Default 6
-K: Keep the original file when compressing



Archive, the archive itself does not imply a compression
Zip: Package compression, do not delete the original file after compression
Zip file1 file2 ...


Tar: Archive tool

-F File.tar: Archived files for operations
-C: Create an archive file
-X: Expand Archive
--xattrs: Preserve extended attribute information when archiving
-T: Do not expand archive to see which files are archived

-Z: Call gzip
-ZCF: Archive and use gzip compression
-ZXF: Unzip and expand the archive using gzip



Linux_ file compression and archiving

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: 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.