Linux common Commands-Compression decompression commands

Source: Internet
Author: User

Compress unzip command

Command name:gzip

Command English original: GUN zip

Command path:/bin/gzip

Execute Permissions: All Users

Syntax: gzip [file]

Function Description: Compress file

File format after compression:. GZ

Command name:gunzip (gzip-b)

Command English original: GUN unzip

Command path:/bin/gunzip

Execute Permissions: All Users

Syntax: gunzip [unzip file]

Function Description: Unzip the. GZ Compressed file Example: Gunzip boduo. gz

Note:Gzip,gunzip can only manipulate files cannot manipulate the directory, the command does not retain the original file

Command name: Tar

Command path:/bin/tar

Execute Permissions: All Users

Syntax: Tar option [-ZCF] [file name after compression] [directory]- C: package;-V: Show details;-F: Specify file name;-Z: Package and compress at the same time;

Function Description: Package directory

File format after compression:. tar.gz

Tar command decompression Syntax:- x: unpack;-V: Show details;-F: Specify compressed file;-Z: Unzip; example: TAR-ZXVF Japan.tar.gz

Note:The tar command adds the option-c/-x can compress and decompress the directory;-Z operation for file in GZ format,-j action for bz2 format file

Command name: Zip

Command path:/usr/bin/zip

Execute Permissions: All Users

Syntax: Zip option [-r] [compressed file name] [file or directory]-r compression Directory

Function Description: Compress directory or file

File format after compression:. zip

unzip(uncompressed)

Command name: bzip2 (upgraded version of Gzip)

Command path:/USR/BIN/BZIP2

Execute Permissions: All Users

Syntax: bzip2 options [-K] [files]-K to save the original file after generating the compressed file

Function Description: Compress file

Compressed file format:. bz2 Example: Bzip2-k boduo tar-cjf Japan.tar.bz2 Japan

Command name: BUNZIP2

Command path:/USR/BIN/BUNZIP2

Execute Permissions: All Users

Syntax: BUNZIP2 option [-K] [compressed file]-K extract preserves original file

Function Description: Decompression example: Bunzip2-k ceshi.bz2 tar-jxvf ceshi.tar.bz2

Linux common Commands-Compression 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.