All compressed files must be written in compressed format extension
. zip Format compression
#压缩文件zip compressed file name source file # compressed directory zip-r compressed filename Source Directory # extract Unzip compressed files
. gz format Compression
The compressed file source file in the #压缩为. gz format disappears from the gzip source file # Compressed file source files in. gz format keep gzip-c source files > Compressed Files # Compress directories under all sub files but cannot compress directories gzip-r Directory # extract gzip-d compressed Files gunzip Compress files
. bz2 format Compression
#压缩为. bz2 format does not retain source file bzip2 source file # compressed after retaining source file bzip2-k source File # Extract-K Preserve compressed file bzip2-d zip file # unzip-K Preserve compressed file Bunzip2 compressed file (Note: The BZIP2 command cannot compress the directory)
Package Command Tar
TAR-CVF package file name source file #-c Package #-v Display procedure #-f specify file name after package TAR-CVF Longs.tar longs
. tar.gz compression format
In fact, the. tar.gz format is packaged in. tar format and then compressed into. gz format
#-z compressed to. tar.gz Format TAR-ZCVF Compressed package name. tar.gz source file #-x unzip. tar.gz Format TAR-ZXVF Compressed package name. TAR.GZ#-C Specifies the decompression location TAR-ZXVF the package name. Tar.gz-c/tmp/
. tar.bz2 Compression Format
In fact, the. tar.bz2 format is packaged in. tar format and then compressed into. bz2 format
#-z compressed to. tar.bz2 Format TAR-JCVF Compressed package name. tar.bz2 source file #-x unzip. tar.bz2 Format TAR-JXVF Compressed package name. TAR.BZ2#-C Specifies the decompression location TAR-JXVF the package name. Tar.bz2-c/TM p/
"Linux Learning note six" compression decompression command