Linux Notes -020-zip compression tool, tar Pack and pack and compress

Source: Internet
Author: User
Tags unpack

Zip compression tool

Support compression directory, do not delete the original file after compression

Preparatory work:

Install the ZIP package and unzip package with the Yum-y install zip unzip and copy the large files to the Aminglinux directory

Zip 1.txt.zip 1. txt: Compressed files

Zip-r aming.zip 1.txt aminglinux/: Files and directories are compressed together

Unzip Aming.zip: Extract uppercase a parameter to all Yes

Unzip 1.txt.zip-d test/: Extract the time specified to extract to the specified directory (file name cannot be changed, what name before compression, what is the name after compression)

Unzip-l aming.zip: See what files are in the compressed package

Tar packaging

Just a packaging tool, not responsible for compression (but because 1 blocks are 4KB, and packaging will do some small compression, so after packaging may be a little change in size)

TAR-CVF Aminglinux.tar aminglinux/: Package A directory: C parameters for the creation, v parameters for the process visualization, F followed by the TAR package name and things to be packaged, C and F are necessary, cannot be omitted

TAR-CVF Aminglinux.tar aminglinux/1.txt 2.txt: Pack The directories and files together

TAR-TF Aminglinux.tar: See what files are in the package

TAR-CVF Aminglinux.tar--exclude aming1--exclude 2.txt aminglinux/1.txt 2.txt: Set to filter the Aming1 directory and 2.txt files when packaging, you can also set *.txt, Filter all txt suffix files

TAR-XVF Aminglinux.tar: Unpacking

Package and Compress

TAR-ZCVF aminglinux.tar.gz aminglinux/1.txt 3.txt:tar can be compressed while packaging, here is gzip, add Z, unpack and unzip can change C to X

TAR-JCVF aminglinux.tar.gz aminglinux/1.txt 3. txt: Compress with bzip2 when packing, add J, unpack and unzip to change C to X

TAR-JCVF aminglinux.tar.xz aminglinux/1.txt 3. txt: Compress with XZ when packing, add J, unpack and unzip to change C to X

TAR-TF AMINGLINUX.TAR.BZ2:TF parameter, even if it is packed, you can view the files in the package

Linux Notes -020-zip compression tool, tar Pack and pack and compress

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.