Linux file compression and archiving

Source: Internet
Author: User

Compression format:

GZ, bz2, XZ, zip, Z.

Gzip:

    • Role

Compress the file. The source file is deleted when the compression is complete.

Gzip/path/to/somefile.

    • Options

-D: Unzip the file.

-num:1-9, specify the compression ratio.

Gunzip

    • Role

Unzip the file. The compressed file is deleted when the decompression is complete.

Gunzip/path/to/somefile.gz.

Zcat

    • Role

View the contents of a text file compressed by gzip in the case of decompression.

BZIP2:

    • Role

Compress the file. Use the format with gzip approximation.

    • Options

-D: Unzip the file.

-num:1-9, specify the compression ratio.

-K: Preserves source files while compressing.

BUNZIP2:

    • Role

Unzip the file.

Bzcat:

    • Role

View the contents of a text file compressed by bzip2 in the case of decompression.

Xz

    • Role

Compress the file.

    • Options

-D: Unzip the file.

-num:1-9, specify the compression ratio.

-K: Preserves source files while compressing.

UNXZ:

    • Role

Unzip the file.

Xzcat:

    • Role

View the contents of a text file compressed by Xzcat in the case of decompression.

Xzdec:

    • Role

Unzip.

Zip:

    • Role

Compress multiple files. Do not delete source files after compression

Zip Filename.zip FILELIST

Unzip

    • Role

Unzip compressed files by Zip.

Tar

    • Role

Archive file. Archive only, do not compress, do not delete source files.

    • Options

-C: Create an archive file.

-F: The archive file for the operation.

-X: Restores the archive.

--xattrs: Retains its extended attribute information when archiving.

-T: Do not expand the archive, directly investigate what files are archived.

-Z: Call gzip archive and compress.

-j: Call bzip2 Archive and compress.

-j: Call XZ Archive and compress.

Cpio

    • Role

Archive file.

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