簡明Linux命令列筆記:bzip2

來源:互聯網
上載者:User
文章目錄
  • 參數
  • 選項
  • 樣本
  • Tips

壓縮和解壓縮檔案bzip2 [options] [file-list]

bunzip2 [options] [file-list]

bzcat [options] [file-list]

bzip2recover [file]

 

bzip2程式用來壓縮檔,bunzip2用來還原bzip2壓縮的檔案,bzcat用於顯示bzip2壓縮檔,bzip2recover用於修複bzip2壓縮時損壞的檔案

 

參數

file-list為要壓縮/解壓縮的一個或多個檔案路徑名列表

 

選項

-c              將壓縮或者解壓縮的結果寫到標準輸出

-d              解壓縮用bzip2壓縮的檔案,該選項用於bzip2 -d,與bunzip2等價

-f               強制壓縮,覆蓋已經存在的檔案

-k              當壓縮或者解壓縮檔案時不刪除輸入檔案

-q              抑制警告資訊,但顯示關鍵資訊

-t               驗證壓縮檔的完整性,如果檔案完整,則不顯示任何資訊

-v              顯示壓縮或解壓縮時的過程資訊

 

樣本bzip2
siu@Darling ~/work $ lsa  b  c  dirsiu@Darling ~/work $ bzip2 asiu@Darling ~/work $ lsa.bz2  b  c  dir

壓縮檔

 bzip2 -v
siu@Darling ~/work $ bzip2 -v b  b:        1.123:1,  7.121 bits/byte, 10.99% saved, 182 in, 162 out.siu@Darling ~/work $ lsa.bz2  b.bz2  c  dir

壓縮檔並顯示壓縮資訊

 

bzcat
siu@Darling ~/work $ bzcat a.bz2 Picture perfect memories scattered all around the floorReaching for the phone 'cause I can't fight it anymoreAnd I wonder if I ever cross your mindFor me it happens all the time

顯示壓縮檔的內容

 bunzip2
siu@Darling ~/work $ bunzip2 a.bz2 siu@Darling ~/work $ lsa  b.bz2  c  dir

解壓檔案

 

bunzip2 -k
siu@Darling ~/work $ bunzip2 -k b.bz2 siu@Darling ~/work $ lsa  b  b.bz2  c  dir

解壓檔案,並保留原檔案

 

Tips

bzip2程式的壓縮效率比gzip要好

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.