Linux File Archive compression and linux File Archive

Source: Internet
Author: User

Linux File Archive compression and linux File Archive
File Archive compression:

Compression and decompression command compression formats: gz, bz2, xz, zip, z

Compression Algorithm: different algorithms and different compression ratios

Compress: FILENAME. Z

Gz: gzip. gz gzip/PATH/TO/SOMEFILE: the original file is deleted after compression.
-D/PATH/TO/SOME_COMPRESSFILE.gz: equivalent TO gunzip
-#: 1-9. Specify the compression ratio. The default value is 6.
Gunzip/PATH/TO/SOME_COMPRESSFILE.gz: After decompression, the original compressed file will be deleted.

Zcat/PATH/TO/SOME_COMPRESSFILE.gz: view the content of a text file without any pressure

Bz2: bzip2. bz2 has a larger compression ratio than gzip, but small files are not dominant, and the format is similar.

Bzip2/PATH/TO/SOMEFILE: compression will delete the original file
-#: 1-9,
-K: the original file is retained during compression.

Bunzip2/PATH/TO/SOMEFILE: Decompress the file and delete the original file.
Bzcat: You can directly view the file content without any pressure.

-#: 1-9
-K: the original file is retained during compression.
Xzdec: Another decompression method, which is output to the screen by default

The preceding three commands only compress files and cannot compress directories.

Zip: Archive and compress. Do not delete the original file zip file1 file2 after compression...
Archive: archive. archive does not mean compression.

Tar: archive tool. Only archive, no compression, no deletion of the original file-c: Create an archive file
-F FILE.tar: the archived file for the operation.
-X: Expand the archive
-- Xattrs: The file is archived at the same time. Preserve the extended attributes of a file
-T: do not expand the archive. Check which files are archived.

-Zcf: Archive and compress it into gzip format
-Zxf: Decompress an archive compressed file in gzip format

-Jcf: bzip2 format

-Jcf: xz format

Cpio: archiving Tool

-P "prompt": Output prompt information

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