Linux compression commands

Source: Internet
Author: User

Linux is commonly used in compression commands, if it is a folder to add-R

1.zip, unzip

2.gzip (the source file disappears after compression)

gzip + source File

GZIP–C ABC > abc.gz (-C command prevents the source file from disappearing).

Note: In the case of gzip compression, only sub-files in the directory are compressed.

Gzip–d, Gunzip + compressed file name decompression.

3.BZIP2 + source file (cannot compress directory)

The source file is not retained by default,-K can save the source file.

BUNZIP2 + Compressed Files Uncompressed default also does not retain the extracted files, plus-K reserved

4. Package command tar normal gzip and bzip2 not easy to compress the directory, or not at all, we can pack the directory before compression.

Format: TAR–CVF package file name source file

-C Packaging

-V Display procedure

-f Specifies the file name after packaging.

Pack and Compress first!

Unpacking: Change C to X

TAR–XVF Packaging files

Is it too much trouble to pack and compress first???? SSSs

In fact, the. tar.gz format is packaged first. tar re-compressed to. gz format

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

-Z indicates compression to. tar.gz format

TAR–ZXVF compressed package name. tar.gz

-X decompression. tar.gz

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

-j indicates compression to. tar.bz2 format

TAR–JXVF compressed package name. tar.bz2

-X unzip. tar.bz2 format

Tar–c specifying the location of the decompression

Compress multiple Files space split

TAR–ZTVF Viewing compressed files

-C To compress
-X To unzip
-j Compressed files or extracted files are
The. tar.bz2 format
-Z Compressed files or extracted files are
The. Tar.gzip format
-T viewing compressed files

Note In fact-Z,-j indicates compression into tar.bz2 or tar.gzip, when the decompression is said to decompress tar.bz2 or Tar.gzip?

Linux compression commands

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