Document compression

First, the compression and packaging of the document

, Gz: gzip compression tool represented by the file compression

, Bz2: bzip2 compression tool is represented by a compressed file

, Tar: tay represented by the file packager packaged (tar does not compress function, it is just a directory merge into one file)

, Tar, gz: package will be appreciated that an existing tar, then the gzipyasuo

.tar, bz2: first by tar package as will be appreciated, then compressed by bzip2

, Tar, xz: can first be understood as a tar package, and then xz compression

1, gzip compression tool: the format is gzip [-d #] filename

                          -d: This parameter is used when decompressing

The back of directly gzip file with the name, expressed compress the file in the current directory, and the original file will disappear

                          - #: Indicates the compression level, 1 is the worst, 9 is the best and 6 is the default

Will complain behind gzip-d command with the expressed compress files decompress files, gzip compression is not supported directory, archive directory

2, bzip2 compression tools: format bzip2 [-dz] filename

                            Only -z (compression) and -d (decompress) the two commonly used options, compression level 1 to 9, when the default level 9, compression, without the -z option can compress files

If the command is not found must install yum -y install bzip2

 

 bzip2 command does not compress the directory, the directory will complain when compression

 

 3, xz compression tools: format xz [-dz] filename

                          There -z (compression) and -d (decompress) the two commonly used options, compression level 1 to 9, when the default level 9, compression, without the -z option can compress files

 

 xz compression can not command the same directory, the directory will complain when compression

 

 4, tar packaging tools: it can be packaged into a file directory, to integrate all the files into one large file, copy or move convenient format tar [-zjxcvfpP] filename tar

                        -z: expressed simultaneously compressed with gzip

                        -j: at the same time expressed compress with bzip2

                        -J: at the same time expressed compress with xz

                        -x: unpacking or decompression represents

                        -t: view expressed tar package file

                        -c: represents establish a tar package or compressed file package

                        -v: visual representation

                        -f: followed by the file name (-f is the filename, represents the compressed file called filename If this is the case of multiple combination of the -f parameter into the last face)

                        -p: Use property represents the original document, what attributes before compression after also what attributes

                        -P: represents an absolute path

                        --exclude filename: said in packaged or compressed, not including the filename file

 

 (Need to install tree command yum install tree)

tar command allows packaging directory can also be packaged file, without the -v option when packaged, said they did not visualize

 

 Whether packing or unpacking, the original file is not deleted, and it will overwrite the current file or directory already exists

 

     --exclube (This option can be ruled out of the file, you can exclude directories)

5, packaged while using gzip compression

The tar command directly compressed when packed, it supports gzip compression, bzip2 compression and compression xz

Use the -z option, you can compress files in gzip format

 

 A list of files -tf option, you can view the package or archive

 

 Use -zxvf option, you can unzip, archive tar, gz format

 

 6, while packaged compressed with bzip2

Gzip compression and the difference is used here -cjvf option to compress

 

 -Tf list of files using the option to view the archive

Use -jxvf option to unpack, tar, bz2 archive format

 

 7,使用zip压缩:可以压缩目录和文件,压缩目录时,需要指定目录下的文件

(如果找不到此命令须先安装   yum -y install zip)

 

      zip后面先跟目标文件名,即压缩后的自定义压缩报名,然后跟要压缩的文件或者目录

当目录下还有二级目录甚至更多及目录时,zip命令仅仅是把耳机目录本身压缩而已,如果想要一并压缩耳机目录下的文件,必须加上-r选项

 

 解压   ,zip格式文件时并不用zip命令,而是用unzip命令(如果系统中没有unzip命令,需先安装)

8,zcat、bzcat命令

 

 

Guess you like

Origin www.cnblogs.com/lzp123/p/12059082.html