ZIP
zip是比較常用的文檔壓縮格式,最大的有點是跨平臺,缺點是支持的壓縮率不是很高。
壓縮
#zip -r studio.zip directory_to_compress
解壓
#unzip studio.zip
TAR
好處是隻消耗非常少的CPU及時間打包,只是一個打包工具,並不負責壓縮。
#tar -cvf studio.tar directory_to_compress
解包
到當前目錄下
#tar -xvf studio.tar
到指定目錄下
#tar -xvf studio.tar -C /tmp/extract/
TAR.GZ
壓縮時不會佔用太多的CPU,就可以得到一個非常理想的壓縮率。
壓縮
#tar -zcvf studio.tar.gz directory_to_compress
解壓
到當前目錄
#tar -zxvf studio.tar.gz
到指定目錄
#tar -zxvf studio.tar.gz -C /tmp/extract/
TAR.BZ2
這種壓縮格式是這幾種方式中壓縮率最好的
# tar -jcvf studio.tar.bz2 directory_to_compress
解壓
到當前目錄
# tar -jxvf studio.tar.bz2
到指定目錄
# tar -jxvf studio.tar.bz2 -C /tmp/extract/