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