. Tar unpack: tarxvfFileName.tar package: tarcvfFileName.tar DirName (note: tar is packed, not compressed !) & Mdash; & mdash ;.
. Tar
Unpack: tar xvf FileName.tar
Package: tar cvf FileName.tar DirName
(Note: tar is packed, not compressed !)
---------------
. Gz
Decompress 1: gunzip FileName.gz
Decompress 2: gzip-d FileName.gz
Compression: gzip FileName
.Tar.gz and. tgz
Decompress: tar zxvf FileName.tar.gz
Compression: tar zcvf FileName.tar.gz DirName
---------------
. Bz2
Decompress 1: bzip2-d FileName.bz2
Decompress 2: bunzip2 FileName.bz2
Compression: bzip2-z FileName
.Tar.bz2
Decompress: tar jxvf FileName.tar.bz2
Compression: tar jcvf FileName.tar.bz2 DirName
---------------
. Bz
Extract 1: bzip2-d FileName. bz
Decompress 2: bunzip2 FileName. bz
Compression: unknown
. Tar. bz
Decompress: tar jxvf FileName.tar. bz
Compression: unknown
---------------
. Z
Decompress: uncompress FileName. Z
Compression: compress FileName
. Tar. Z
Decompress: tar Zxvf FileName.tar. Z
Compression: tar Zcvf FileName.tar. Z DirName
---------------
. Zip
Decompress: unzip FileName.zip
Compression: zip FileName.zip DirName
---------------
. Rar
Decompress: rar x FileName.rar
Compression: rar a FileName.rar DirName
Rar please download to: http://www.rarsoft.com/download.htm!
After decompression, copy rar_static to the/usr/bin directory (OthersThe directory specified by the $ PATH environment variable can also be ):
[Root @ www2 tmp] # cp rar_static/usr/bin/rar
---------------
. Lha
Decompress: lha-e FileName. lha
Compression: lha-a FileName. lha FileName
Lha please: http://www.infor.kanazawa-it.ac.jp /~ Ishii/lhaunix/download!
> After decompression, copy lha to the/usr/bin directory (other directories specified by the $ PATH environment variable can also be used ):
[Root @ www2 tmp] # cp lha/usr/bin/
---------------
. Rpm
Unpack: rpm2cpio FileName. rpm | cpio-div
---------------
. Deb
Unpack: ar p FileName. deb data.tar.gz | tar zxf-
---------------
. Tar. tgz .tar.gz. tar. z. tar. bz .tar.bz2. zip. cpio. rpm. deb. slp. arj. rar. ace. lha. lzh. lzx. lzs. arc. sda. sfx. lnx. zoo. cab. kar. cpt. pit. sit. sea
Decompress: sEx x FileName .*
Compression: sEx a FileName. * FileName
SEx only calls related programs and does not support compression or decompression. please note!
For sEx, go to http://sourceforge.net/projects/sexto download it!
After decompression, copy sEx to the/usr/bin directory (other directories specified by the $ PATH environment variable can also be used ):
[Root @ www2 tmp] # cp sEx/usr/bin/
Gzip command
There are two obvious advantages to reduce the file size. one is to reduce the storage space, and the other is to reduce the transmission time when the file is transmitted over the network. Gzip is a frequently used command in Linux to compress and decompress files, which is convenient and easy to use.
Syntax: gzip [option] compressed (decompressed) file name
The options of this command are as follows:
-C writes the output to the standard output and keeps the original file. -D. decompress the compressed file. -L the following fields are displayed for each compressed file: size of the compressed file, size of the uncompressed file, and compression ratio; name of the uncompressed file-r recursively searches for the specified directory and compresses all the files or decompress them. -T test to check whether the compressed file is complete. -V displays the file name and compression ratio for each compressed and decompressed file. -Num uses the specified numeric num to adjust the compression speed.-1 or -- fast indicates the fastest compression method (low compression ratio), and-9 or -- best indicates the slowest compression method (high compression ratio ). The default value is 6.
Command instance:
Gzip * % compresses each file in the current directory into a. gz file. Gzip-dv * % decompress each compressed file in the current directory and list detailed information. Gzip-l * % detailed information of each compressed file in Example 1 is displayed without decompression. Gzip usr.tar %: the compressed tar backup file usr.tar. the extension name of the compressed file is .tar.gz.