Around Linux20180419 Fifth class (April 17)

Source: Internet
Author: User
Tags unpack

around Fifth class (April 17)

6.5 Zip compression tool
6.6 Tar Pack
6.7 Packing and compressing
Take a look at this post: http://ask.apelearn.com/question/5435



Zip compression tool supports compressed directory


General RAR files can not be decompressed under Linux

The usage is not quite the same

Zip compressed file name after compressed


Zip archive directory

Directory file name to compress after zip compression

and zip compression does not delete the original file


You can use the-D option to specify the path after decompression

Unzip to unzip file-D after decompression path


Zip package cannot view content directly


Zip can not specify the name after decompression, still is the name before compression.


You can view a list of files in a compressed package

Unzip-l




Tar Packaging tools


Suppose a situation:

Several directories need to be transferred but there are up to 10,000 files in the directory, because the transmission process is one transmission, so the time required is superimposed.

Packaging is to package all the files into a large file, to transfer the large file.

And there is a situation is if the small files are less than 4k, a file 4k,10000 is 40000k 40M

And packaging, you will add less than 4k of files, so the average size of each file will be reduced, the total packaged data will be less than 40M


TAR-CVF File/directory to be packaged after the file name is packaged

c = Create

V indicates visual

F indicates the following file name

So f is a must, because the file name after the packaging, V but extinguished the


So the size is almost non-changeable, starting a lot less than 4k of files

The package can be a directory, a file, or a combination of directories and files


Unpacking is with-XVF

If you want to unpack to a specific path, you need the-C option

Tar XVF Package-C unpack path


TAR-TF package to see the list in the package


If the situation is not all the files in a directory you want to pack, how?

You can use--exclude to get rid of them.


TAR-CVF package. Tar--exclude a file and then package the directory or file

If more than one file needs to be filtered, you need to write--exclude on each front. Wildcard characters such as--exclude "*.txt" are supported



Tar package and Compress

Remember which compression method is written in the option, and which type of compression suffix to add to the corresponding file name

Z-------GZ

J--------bz2

J-------XZ

Because the zip Note is able to compress the directory, it is not used here. Because of this understanding, the entire process is first packaged, then compressed, so no matter what compression method, compression is targeted at this package.



TAR-TF can view the list of files directly. Whether it is compressed or a package is used-TF

Around Linux20180419 Fifth class (April 17)

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.