Linux compression commands (tar,gzip,zip)

Source: Internet
Author: User

Packaging and compression. Packaging refers to a large number of files or directories into a total file, compression is a large file through some compression algorithm into a small file.

This is due to the many compression programs in Linux that can only be compressed for one file, so that when you want to compress a lot of files, you have to first make the whole heap of files into a package (tar command), and then compress with the compression program.

1.tar (for tar packages) reference: http://blog.csdn.net/eroswang/article/details/5555415/

Package that the TAR parameter is packaged in

Parameter:-C Create Package-X unpacking-T view (required, and only one option)

-Z compress into gzip, or unzip gzip (extension, GZ): TAR-CZVF 1.tar.gzip * (Package the contents of the current directory into 1.tar.gzip)

-j compressed into bzip2, or decompression bzip2 (extension, bz2): TAR-CJVF 1.tar.bz2 *

-V Process Visual

-F document name, followed by a direct connection to the document name, cannot be other.

2.gzip (for GZ packages)

3.zip and unzip (for zip packages)

Compress a file or directory into a zip:

Command format: Zip parameter compressed after name compressed file

Common parameters:-r recursive directory, which is a subdirectory of the compressed directory will also be included.

-D Delete a file in a compressed package: zip-d files deleted by the archive

-M adding files to a compressed package: Zip-m Package Add files

Unzip the zip file:

Command format: Unzip parameter extracted file

Common parameters:-D extract to which directory;

Linux compression commands (tar,gzip,zip)

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.