linux-Compression and Decompression commands

Source: Internet
Author: User

Commonly used compression formats:. zip. gz. bz2. tar.gz. tar.bz2

1.Zip

Compressed files: Zip Compressed file name source file

Compressed directory: Zip-r compressed file name source file

Unzip. zip file: Unzip compressed file

2.gz

Gzip source files: Compressed files in. gz format, source files disappear

Gzip-c source Files > Compressed files: Preserving source files

Gzip-r Directory: Compress all sub-files in the directory, but cannot compress the directory

gzip-d Compressed Files: extracting

Gunzip Compressed Files: extracting

3.bz2

bzip2 source file: Compressed to. bz2 format, without preserving source files

Bzip2-k source files: preserving source files

Cannot compress directory

bzip2-d Compressed Files

BUNZIP2 Compressed Files

4.tar.gz

Packaging commands, and then compressing

TAR-CVF package file name source file

-C: Packaging

-V: Display procedure

-F: Specifies the file name after packaging

Unpacking commands

TAR-XVF Package file name

The tar.gz format is packaged in. tar format and then compressed into. gz format

TAR-ZCVF compressed package name. tar.gz Source File

-Z: Compressed to. tar.gz format

TAR-ZXVF compressed package name. tar.gz

-X: Unzip. tat.gz. Format

5.tar.bz2

TAR-JCVF compressed package name. tar.bz2 Source File

-J: Compressed to. tar.bz2 format

TAR-JXVF-C (Specifies the decompression location) to compress the package name. tar.bz2

-X: Unzip. tat.bz2. Format

TAR-ZTVF compressed file name: viewing compressed files

linux-Compression and Decompression commands

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.