gzip解壓縮命令

2021-07-02 03:53:41 字數 934 閱讀 8333

gzip和bzip2適合於單個檔案,tar適合於目錄

//.gz格式

gzip -9 hello.c  //以最大的壓縮比壓縮檔案(-1(最小)~-9),生成了hello.c.gz

gzip -d hello.c.gz //加壓檔案,解壓後hello.c.gz檔案會被刪除

gunzip hello.c.gz //等效於gzip -d hello.c.gz

zcat hello.c.gz //檢視壓縮包內容

//.bz2格式,解壓的時候適合.bz, .bz2, .tbz, .tbz2等格式

bzip2 -z hello.c

bzip2 -d hello.c.bz2

bzcat hello.c.bz2  //檢視壓縮包內容

//刪除目錄和檔案

rm -rf hello.exe

rm -rf hello  //刪除目錄

//tar打包目錄,如果還要壓縮請在引數裡面加z

tar -cvf hello.tar hello

tar -xvf hello.tar

tar -zcvf hello.tar.gz hello

tar -zxvf hello.tar.gz

tar -tvf hello.tar

tar -ztvf hello.tar.gz  //檢視包裡面有哪些檔案

tar -zcvpf hello.tar.gz /home/amugou/hello  //p引數意味著使用絕對路徑,將/home/amugou/hello打包,壓縮以後會包含各級檔案路徑,解壓以後也會包含各級目錄

tar -n '2012/06/25' -zcvf hello.tar.gz hello

tar -zcvf hello.tar.gz hello --exclude hello.exe --exclude hello.i  和hello.i檔案不打包

gzip格式解壓縮

gzip格式解壓縮 有時候網路請求中會出現gzip格式的資料,而我們無法通過常規辦法進行解析 這時候可以使用下面的這個工具來解決這個問題 注意,使用的時候需要引入乙個lib 本人寫好的示例 gzipdatacompression created by youxianming on 16 3 12.i...

symbian壓縮和解壓縮GZIP檔案

開發夥伴平台 s60 3rd edition,fp1 詳細描述 下列 片段演示了如何壓縮和解壓縮gzip檔案,這裡使用了cezfiletogzip類和cezgziptofi類。可以通過自簽名執行。mmp檔案 需要下列鏈結庫 code library efsrv.lib library ezlib.l...

壓縮解壓縮命令

gzip 所在目錄 bin gzip,壓縮檔案,壓縮後檔案格式為.gz 用法 gzip 選項 檔案 例 gzip newfile linux的壓縮格式windows都支援 如好壓 但windows的壓縮格式linux不一定支援要有相應的軟體,gzip只能壓縮檔案,不能壓縮目錄,壓縮後不保留原檔案 g...