Basic-"034" Linux compression and archiving

Source: Internet
Author: User

One, compression format

1. The compression format includes the following formats: Gz,bz2,xz,zip,z

2. compression tools and corresponding compression objects

Note:

①XZ is the mainstream compression method, compression ratio, the speed is slightly slower;

②zip is an archived and compressed tool that is archived using the Archive command, and the archive itself does not imply compression;

③tar is a dedicated archive tool, archived after file. Tar ends. Tar-c (Create archive), Tar-f [file name after archive. Tar],tar-x (expand Archive), Tar-t (do not expand the archive to view directly which files are included in the archived file). The archive file is larger than the sum of each file size before the archive, where the tar command can invoke other compression tools;

④TAR-ZCF (archive and call gzip), TAR-ZXF (call gzip to unzip and expand Archive,-Z option can be omitted)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/49/60/wKiom1QTpvWhswoMAAC-hZaqxR0157.png "title=" capture. PNG "alt=" Wkiom1qtpvwhswomaac-hzaqxr0157.png "/>


Two, compression algorithm

Note: The algorithm is different, compression ratio (before compression size-compression size/pre-compression size = Compression ratio) is different.

Third, practice

1. Write a script that allows the user to enter several files from the keyboard, which enables the script to compress several files entered by the user into a single file.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/49/62/wKioL1QTpxeCRT_KAAFvo5qJmlI525.jpg "title=" 1.jpg " alt= "Wkiol1qtpxecrt_kaafvo5qjmli525.jpg"/>



This article is from the "Mangguo" blog, make sure to keep this source http://mangguostudy.blog.51cto.com/5643869/1551837

Basic-"034" Linux compression and archiving

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.