Section VI compression packing command

gzip compression (decompression) file, directory can not be compressed, does not retain the original file
compression syntax: gzip file
unzip syntax: gunzip file
gzip -d file

bzip compression (decompression) file, directory can not be compressed, the compressed file suffix .bz2
syntax: bzip [-k] [file]
-k generated after compression to retain the original file (high compression ratio)
-d parameter extracting
unzip using bzip -d or bunzip2

a zip or unzip files compressed file suffix .zip, retain the original file
syntax: zip option [-r] [name of the compressed file] [file or directory]
-r -r compression did not write directory, archive directory, no data compressed file
decompression using unzip, the main document if the same name already exists decompression, will not be covered

tar file, directory play (solution) package, the source files are not deleted reservations
syntax: the tar [-zcf] compression to compress the file name of the file or directory name
-c command to establish the parameters of a compressed file (create), suffix .tar
the -X-unlock command a parameter file (Extract) compressing
-z gzip command to compress / decompress files
-j bzip to compress / decompress the file
-v display file compression process (verbose)
-f file file name specified , Required
separate package tar -cf tar -xf, unpack

One step compression packing (unpacking decompression)
gzip -zcvf (compressed file name) (to be compressed filename)
tar -czf ag.tgz a.txt
tar -zxvf (unpack to decompress the file name)
tar-zxf ag.tgz

tar -cf -xf single compression, decompression
tar -z gzip package and to a compressed file format: .tar.gz (.tgz)
the tar -j to bzip compressed package and directory file formats: .tar.bz2

tar -zcvf dir1.tar.gz dir1 directory dir1da packaged and compressed into a zip file dir1.tar.gz
the tar -zxvf dir1.tar.gz -C / root / a to the specified decompression / root / a path
tar -cvf bak .tar current directory file is packaged into bak.tar
the tar -xvPf bak.tar extract to the current directory, the default path is relative, P parameter is the absolute path
tar -cvPf bak.tar / a / b a / a / b path compression to bak.tar
the tar or gzip bak.tar -zcvf bak.tar.gz bak.tar packaged using gzip compressed file bar.tar bak.tar.gz
the tar -rvf bak.tar / etc / password the / etc / password bak.tar added to the
tar -cjvf test.tar.bz2 test generation tset.tar.bz2 archive
tar -xjf test.tar.bz2 decompression

Guess you like

Origin www.cnblogs.com/kogmaw/p/12409975.html
Recommended