精品欧美一区二区三区在线观看 _久久久久国色av免费观看性色_国产精品久久在线观看_亚洲第一综合网站_91精品又粗又猛又爽_小泽玛利亚一区二区免费_91亚洲精品国偷拍自产在线观看 _久久精品视频在线播放_美女精品久久久_欧美日韩国产成人在线

bzip2 中文man頁(yè)面

系統(tǒng)
bzip2 采用 Burrows-Wheeler 塊排序文本壓縮算法和 Huffman 編碼方式壓縮文件。壓縮率一般比基于 LZ77/LZ78 的壓縮軟件好得多,其性能接近 PPM 族統(tǒng)計(jì)類壓縮軟件。

NAME 命令名


bzip2, bunzip2 - 一種塊排序文件壓縮軟件,v0.9.5
bzcat - 將文件解壓縮至標(biāo)準(zhǔn)輸出
bzip2recover - 恢復(fù)損壞的 bzip2 文件

總覽

bzip2 [ -cdfkqstvzVL123456789 ] [ filenames ... ]
bunzip2 [ -fkvsVL ] [ filenames ... ]
bzcat [ -s ] [ filenames ... ]
bzip2recover filename

描述

bzip2 采用 Burrows-Wheeler 塊排序文本壓縮算法和 Huffman 編碼方式壓縮文件。壓縮率一般比基于 LZ77/LZ78 的壓縮軟件好得多,其性能接近 PPM 族統(tǒng)計(jì)類壓縮軟件。

命令行參數(shù)有意設(shè)計(jì)為非常接近 GNU gzip 的形式,但也不完全相同。

bzip2 從命令行讀入文件名和參數(shù)。 每個(gè)文件被名為 "原始文件名.bz2" 的壓縮文件替換。每個(gè)壓縮文件具有與原文件相同的修改時(shí)間、 權(quán)限, 如果可能的話,還具有相同的屬主, 因此在解壓縮時(shí)這些特性將正確地恢復(fù)。在某些文件系統(tǒng)中, 沒(méi)有權(quán)限、 屬主或時(shí)間的概念,或者對(duì)文件名的長(zhǎng)度有嚴(yán)格限制, 例如 MSDOS, 在這種情況下,bzip2 沒(méi)有保持原文件名、 屬主、 權(quán)限以及時(shí)間的機(jī)制,從這個(gè)意義上說(shuō),bzip2 對(duì)文件名的處理是幼稚的。

bzip2bunzip2 在缺省情況下不覆蓋已有的文件。 如果想覆蓋已有的文件,要指定 -f 選項(xiàng)。

如果未指定文件名, bzip2 將壓縮來(lái)自標(biāo)準(zhǔn)輸入的數(shù)據(jù)并寫(xiě)往標(biāo)準(zhǔn)輸出。在這種情況下, bzip2 會(huì)拒絕將壓縮結(jié)果寫(xiě)往終端,因?yàn)檫@完全無(wú)法理解并且是沒(méi)有意義的。

bunzip2 (以及 bzip2 -d) 對(duì)所有指定的文件進(jìn)行解壓縮處理。不是由 bzip2 產(chǎn)生的文件將被忽略,同時(shí)發(fā)出一個(gè)警告信息。 bzip2 按下列方式由壓縮文件名確定解壓后的文件名:


       filename.bz2    解壓成   filename
       filename.bz     解壓成   filename
       filename.tbz2   解壓成   filename.tar
       filename.tbz    解壓成   filename.tar
       anyothername    解壓成   anyothername.out

如果文件名的后綴不是下列之一: .bz2, .bz, .tbz2.tbz, .bzip2 將抱怨無(wú)法確定原始文件名,并采用原文件名加 .out 作為解壓縮文件名。

在壓縮時(shí),如果不提供文件名,bzip2 將從標(biāo)準(zhǔn)輸入讀取數(shù)據(jù),壓縮結(jié)果寫(xiě)往標(biāo)準(zhǔn)輸出。

bunzip2 能夠正確地解壓由兩個(gè)或更多個(gè)壓縮文件連在一起的文件。解壓的結(jié)果為相應(yīng)的連在一起的未壓縮文件。
 bzip2 也支持對(duì)連在一起的壓縮文件的完整性檢查(-t選項(xiàng))。

同樣可采用 -c 選項(xiàng)將文件壓縮或解壓縮至標(biāo)準(zhǔn)輸出。多個(gè)文件可通過(guò)這種方式壓縮或解壓縮。輸出結(jié)果被依次送往標(biāo)準(zhǔn)輸出。 采用這種方式對(duì)多個(gè)文件的壓縮將生成包含多個(gè)壓縮文件的數(shù)據(jù)流。這樣的數(shù)據(jù)流只能被 0.9.0 版或其后續(xù)版本的 bzip2 正確解壓。較早版本的 bzip2 會(huì)在解壓完第一個(gè)文件之后停止。

bzcat (或 bzip2 -dc) 將所有指定文件解壓縮至標(biāo)準(zhǔn)輸出。

bzip2 可從環(huán)境變量 BZIP2BZIP 中依次讀取參數(shù), 并在命令行參數(shù)之前對(duì)其進(jìn)行處理。 這是提供缺省選項(xiàng)的方便途徑。

即使壓縮后的文件略大于原文件, 壓縮也總是照樣進(jìn)行。小于大約 100 字節(jié)的文件壓縮后傾向于變大,因?yàn)闀?huì)有一個(gè) 50 字節(jié)的數(shù)據(jù)頭。 對(duì)于隨機(jī)數(shù)據(jù) (包括大多數(shù)壓縮軟件的輸出), 大約每字節(jié)壓成 8.05 位, 放大率約為 0.5%。

bzip2 采用 32 位 CRC 校驗(yàn)碼作自我檢查,以確認(rèn)解壓后的文件與原始文件相同。這可用于檢測(cè)壓縮文件是否損壞,并防止 bzip2 中未知的缺陷(運(yùn)氣好的話這種可能性非常小)。 數(shù)據(jù)損壞而未檢測(cè)到的幾率非常之小,對(duì)于每個(gè)被處理的文件大約是四十億分之一。檢查是在解壓縮時(shí)進(jìn)行的, 因此它只能說(shuō)明某個(gè)地方出問(wèn)題了。它能幫助恢復(fù)原始未壓縮的數(shù)據(jù)。可以用 bzip2recover 來(lái)嘗試從損壞的文件中恢復(fù)數(shù)據(jù)。

返回值:正常退出返回 0, 出現(xiàn)環(huán)境問(wèn)題返回 1 (文件未找到,非法的選項(xiàng),I/O錯(cuò)誤等),返回 2 表明壓縮文件損壞,出現(xiàn)導(dǎo)致 bzip2 緊急退出的內(nèi)部一致性錯(cuò)誤(例如缺陷)時(shí)返回 3。

選項(xiàng)

-c --stdout
將數(shù)據(jù)壓縮或解壓縮至標(biāo)準(zhǔn)輸出。
-d --decompress
強(qiáng)制解壓縮。 bzip2, bunzip2 以及 bzcat 實(shí)際上是同一個(gè)程序,進(jìn)行何種操作將根據(jù)程序名確定。指定該選項(xiàng)后將不考慮這一機(jī)制,強(qiáng)制 bzip2 進(jìn)行解壓縮。
-z --compress
-d 選項(xiàng)的補(bǔ)充:強(qiáng)制進(jìn)行壓縮操作,而不管執(zhí)行的是哪個(gè)程序。
-t --test
檢查指定文件的完整性,但并不對(duì)其解壓縮。實(shí)際上將對(duì)數(shù)據(jù)進(jìn)行實(shí)驗(yàn)性的解壓縮操作,而不輸出結(jié)果。
-f --force
強(qiáng)制覆蓋輸出文件。通常 bzip2 不會(huì)覆蓋已經(jīng)存在的文件。該選項(xiàng)還強(qiáng)制 bzip2 打破文件的硬連接,缺省情況下 bzip2 不會(huì)這么做。
-k --keep
在壓縮或解壓縮時(shí)保留輸入文件(不刪除這些文件)。
-s --small
在壓縮、 解壓縮及檢查時(shí)減少內(nèi)存用量。 采用一種修正的算法進(jìn)行壓縮和測(cè)試,每個(gè)數(shù)據(jù)塊僅需要 2.5 個(gè)字節(jié)。這意味著任何文件都可以在 2300k 的內(nèi)存中進(jìn)行解壓縮,盡管速度只有通常情況下的一半。

在壓縮時(shí),-s將選定 200k 的塊長(zhǎng)度,內(nèi)存用量也限制在 200k 左右,代價(jià)是壓縮率會(huì)降低。總之,如果機(jī)器的內(nèi)存較少(8兆字節(jié)或更少),可對(duì)所有操作都采用-s選項(xiàng)。參見(jiàn)下面的內(nèi)存管理。

-q --quiet
壓制不重要的警告信息。屬于 I/O 錯(cuò)誤及其它嚴(yán)重事件的信息將不會(huì)被壓制。
-v --verbose
詳盡模式 -- 顯示每個(gè)被處理文件的壓縮率。命令行中更多的 -v 選項(xiàng)將增加詳細(xì)的程度,使 bzip2 顯示出許多主要用于診斷目的信息。
-L --license -V --version
顯示軟件版本,許可證條款及條件。
-1 to -9
在壓縮時(shí)將塊長(zhǎng)度設(shè)為 100 k、200 k .. 900 k。對(duì)解壓縮沒(méi)有影響。參見(jiàn)下面的內(nèi)存管理。
--
將所有后面的命令行變量看作文件名,即使這些變量以減號(hào)"-"打頭。可用這一選項(xiàng)處理以減號(hào)"-"打頭的文件名,例如:bzip2 -- -myfilename.
--repetitive-fast --repetitive-best
這些選項(xiàng)在 0.9.5 及其以上版本中是多余的。在較早的版本中,這兩個(gè)選項(xiàng)對(duì)排序算法的行為提供了一些粗糙的控制,有些情況下很有用。 0.9.5 及其以上版本采用了改進(jìn)的算法而與這些選項(xiàng)無(wú)關(guān)。

內(nèi)存管理

bzip2 按照數(shù)據(jù)塊壓縮大文件。 數(shù)據(jù)塊長(zhǎng)度同時(shí)影響數(shù)據(jù)的壓縮率和壓縮及解壓縮時(shí)需要的內(nèi)存用量。 選項(xiàng) -1 至 -9 將數(shù)據(jù)塊長(zhǎng)度分別指定為 100,000 字節(jié)至 900,000(缺省)字節(jié)。在解壓縮時(shí), 壓縮時(shí)使用的塊長(zhǎng)度從壓縮文件的頭中讀取,同時(shí) bunzip2 分配出剛好夠用的內(nèi)存對(duì)文件進(jìn)行解壓縮。由于數(shù)據(jù)塊長(zhǎng)度保存在壓縮文件中, 所以在解壓縮時(shí)不需要 -1 至 -9 這些選項(xiàng),因而將被忽略。

可以按下面的公式估計(jì)壓縮和解壓縮時(shí)的內(nèi)存用量,單位為字節(jié):


       壓縮:   400k + ( 8 x 數(shù)據(jù)塊長(zhǎng)度 )


       解壓縮: 100k + ( 4 x 數(shù)據(jù)塊長(zhǎng)度 ), 或
                      100k + ( 2.5 x 數(shù)據(jù)塊長(zhǎng)度 )

大數(shù)據(jù)塊長(zhǎng)度產(chǎn)生迅速縮小的臨界返回 (give rapidly diminishing marginal returns)。在小機(jī)器上使用 bzip2 時(shí), 一個(gè)值得記住的事實(shí)是, 大多數(shù)壓縮來(lái)自數(shù)據(jù)塊長(zhǎng)度的前 200 或 300k。另外重要的一點(diǎn)是, 解壓縮時(shí)內(nèi)存的需要量是在壓縮時(shí)用塊長(zhǎng)度選項(xiàng)設(shè)定的。

對(duì)于缺省用 900k 的數(shù)據(jù)塊長(zhǎng)度壓縮的文件, bunzip2 大約需要 3700k 字節(jié)的內(nèi)存進(jìn)行解壓縮。為支持一臺(tái) 4MB 機(jī)器上任何文件的解壓縮, bunzip2 有一個(gè)選項(xiàng)大約只需一半容量的內(nèi)存,約 2300k 字節(jié)。 解壓縮速度同樣也降低一半。因此應(yīng)該只在需要時(shí)采用該選項(xiàng)。相應(yīng)的選項(xiàng)標(biāo)志為 -s。

一般來(lái)說(shuō),應(yīng)盡量采用內(nèi)存允許的最大數(shù)據(jù)塊長(zhǎng)度,因?yàn)檫@能達(dá)到最好的壓縮率,壓縮和解壓縮速度實(shí)質(zhì)上不受塊長(zhǎng)度的影響。

另一個(gè)值得注意的問(wèn)題是關(guān)于小于一個(gè)數(shù)據(jù)塊長(zhǎng)度的文件的, 也就是說(shuō), 所遇到的大多數(shù)文件使用一個(gè)大數(shù)據(jù)塊。 由于文件長(zhǎng)度小于一個(gè)數(shù)據(jù)塊長(zhǎng)度,實(shí)際使用到的內(nèi)存與文件長(zhǎng)度成正比。例如,采用 -9 選項(xiàng)壓縮一個(gè) 20,000 字節(jié)的文件時(shí),將分配 7600k 的內(nèi)存,但其中只用到了 400k+20000*8=560k 字節(jié)。同樣地,在解壓縮時(shí)將分配 3700k 內(nèi)存,但只用到 100k + 20000 * 4 = 180 k 字節(jié)。

下表總結(jié)了不同數(shù)據(jù)塊長(zhǎng)度下的內(nèi)存用量。同時(shí)列出的還有 Calgary 文本壓縮語(yǔ)料庫(kù)中的 14 個(gè)文件的壓縮長(zhǎng)度,這 14 個(gè)文件壓縮前總長(zhǎng)度為 3,141,622 字節(jié)。這些數(shù)據(jù)顯示了壓縮率是如何隨數(shù)據(jù)塊長(zhǎng)度變化的。由于這一語(yǔ)料庫(kù)主要由小文件組成, 所以這些數(shù)字并沒(méi)有充分體現(xiàn)出大文件情況下,采用大數(shù)據(jù)塊所能達(dá)到的較高壓縮率的優(yōu)勢(shì)。


           壓縮時(shí)      解壓縮     解壓縮 -s     語(yǔ)料庫(kù)文件
    Flag   內(nèi)存用量   內(nèi)存用量   選項(xiàng)內(nèi)存用量   壓縮長(zhǎng)度


     -1      1200k       500k         350k      914704
     -2      2000k       900k         600k      877703
     -3      2800k      1300k         850k      860338
     -4      3600k      1700k        1100k      846899
     -5      4400k      2100k        1350k      845160
     -6      5200k      2500k        1600k      838626
     -7      6100k      2900k        1850k      834096
     -8      6800k      3300k        2100k      828642
     -9      7600k      3700k        2350k      828642

從損壞的文件中恢復(fù)數(shù)據(jù)

bzip2 按數(shù)據(jù)塊對(duì)數(shù)據(jù)進(jìn)行壓縮,數(shù)據(jù)塊長(zhǎng)度通常為 900k 字節(jié)。每個(gè)數(shù)據(jù)塊被獨(dú)立地處理。如果由于介質(zhì)或傳輸錯(cuò)誤導(dǎo)致多數(shù)據(jù)塊的 .bz2 文件損壞,有可能將文件中未損壞的數(shù)據(jù)塊中的數(shù)據(jù)恢復(fù)。

壓縮后的數(shù)據(jù)塊以一個(gè) 48 位的結(jié)構(gòu)分界,因而有可能在合理的范圍內(nèi)找到塊邊界。每個(gè)數(shù)據(jù)塊也帶著自己的 32 位 CRC 校驗(yàn)碼,因此可以區(qū)分損壞與未損壞的數(shù)據(jù)塊。

bzip2recover 是一個(gè)簡(jiǎn)單的程序,它的功能是在 .bz2 文件中尋找數(shù)據(jù)塊,并將每個(gè)數(shù)據(jù)塊寫(xiě)到自己的 .bz2 文件中。然后可以用 bzip2 -t 測(cè)試結(jié)果的完整性,將未損壞的部分解壓縮。

bzip2recover 只有一個(gè)命令行變量,即損壞文件的名字。輸出結(jié)果是一系列象 "rec0001file.bz2"、 "rec0002file.bz2" 這樣的文件,每個(gè)文件含有從損壞文件中找出的數(shù)據(jù)塊。輸出文件名設(shè)計(jì)為在接下來(lái)的處理中可方便地使用通配符,例如,"bzip2 -dc rec*file.bz2>recovered_data",可按正確的次序列出文件。

bzip2recover 在處理大文件時(shí)最有用, 因?yàn)榇笪募泻芏鄶?shù)據(jù)塊。顯然用它處理單個(gè)數(shù)據(jù)塊的損壞文件不會(huì)有任何結(jié)果,因?yàn)橐粋€(gè)損壞的數(shù)據(jù)塊是無(wú)法恢復(fù)的。如果想盡量減少潛在的由于介質(zhì)及傳輸錯(cuò)誤導(dǎo)致的數(shù)據(jù)損壞,可以考慮采用較小的數(shù)據(jù)塊長(zhǎng)度進(jìn)行壓縮。

有關(guān)性能的注解

在壓縮的排序階段, 相似的字符串將被聚集在一起。 因此, 對(duì)于包含很長(zhǎng)重復(fù)符號(hào)的文件, 例如象 "aabaabaabaab......" 這樣的字符串(重復(fù)幾百次), 壓縮速度會(huì)比通常情況慢得多。 0.9.5 及其以上版本在處理這樣的重復(fù)時(shí), 速度比以前版本提高了很多。 最壞情況與平均情況下的壓縮時(shí)間之比約為 10:1。 對(duì)于以前的版本,這一數(shù)字大約是 100:1 以上。你如果愿意,可采用 -vvvv 選項(xiàng)來(lái)非常詳細(xì)地監(jiān)視這一過(guò)程。

解壓縮速度并不受這些現(xiàn)象的影響。

bzip2 通常分配出幾兆字節(jié)的內(nèi)存用于處理數(shù)據(jù), 對(duì)這些內(nèi)存的訪問(wèn)是以相當(dāng)隨機(jī)的方式進(jìn)行的。 這意味著, 壓縮及解壓縮的性能在很大程度上取決于機(jī)器上處理高速緩存未命中的速度。 因此,已經(jīng)觀察到對(duì)程序作很小的減少失敗率的改動(dòng)會(huì)導(dǎo)致不成比例的很大的性能上的提升。 我設(shè)想 bzip2 在有大量高速緩存機(jī)器上的性能最佳。

警告

I/O 錯(cuò)誤信息并不是很有用。 bzip2 會(huì)盡量探測(cè) I/O 錯(cuò)誤信息并干凈地退出, 但問(wèn)題的細(xì)節(jié)有時(shí)看上去很容易引起誤解。

本手冊(cè)頁(yè)適用于 0.9.5 版的 bzip2。 由這一版本的 bzip2 產(chǎn)生的壓縮數(shù)據(jù)與以前的公開(kāi)版本 0.1pl2、0.9.0 完全兼容,但有一個(gè)例外:0.9.0 及其以上版本能正確解壓縮多個(gè)連在一起的壓縮文件,0.1pl2 則不能, 它將在解壓縮完數(shù)據(jù)流中的第一個(gè)文件之后停止。

bzip2recover 采用 32 位的整型數(shù)表示壓縮文件中位的位置,因此它無(wú)法處理大于 512 兆字節(jié)的文件。但這一問(wèn)題很容易解決。

作者

Julian Seward, jseward@acm.org.

http://www.muraroa.demon.co.uk

bzip2 包含的想法及概念至少歸功于下列人員: Michael Burrows 和 David Wheeler(塊排序變換), David Wheeler(Huffman 編碼器), Peter Fenwick(原始 bzip 的結(jié)構(gòu)編程模型及許多改進(jìn)),Alistair Moffat、 Ian Witten(原始 bzip 中的算法編碼)。我非常感激他們的幫助、 支持以及建議。 參見(jiàn)源發(fā)布的手冊(cè)中有關(guān)文檔來(lái)源中的線索。 Christian von Roques 曾鼓勵(lì)我尋找更快的排序算法, 以提高壓縮速度。 bela Lubkin 曾鼓勵(lì)我改進(jìn)最壞情況下的壓縮性能。 很多人給我發(fā)來(lái)修補(bǔ)程序, 幫助解決移植問(wèn)題,租借機(jī)器,提出建議等。

#p#

NAME

bzip2, bunzip2 - a block-sorting file compressor, v1.0.2
bzcat - decompresses files to stdout
bzip2recover - recovers data from damaged bzip2 files

SYNOPSIS

bzip2 [ -cdfkqstvzVL123456789 ] [ filenames ... ]
bunzip2 [ -fkvsVL ] [ filenames ... ]
bzcat [ -s ] [ filenames ... ]
bzip2recover filename

DESCRIPTION

bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression is generally considerably better than that achieved by more conventional LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors.

The command-line options are deliberately very similar to those of GNU gzip, but they are not identical.

bzip2 expects a list of file names to accompany the command-line flags. Each file is replaced by a compressed version of itself, with the name "original_name.bz2". Each compressed file has the same modification date, permissions, and, when possible, ownership as the corresponding original, so that these properties can be correctly restored at decompression time. File name handling is naive in the sense that there is no mechanism for preserving original file names, permissions, ownerships or dates in filesystems which lack these concepts, or have serious file name length restrictions, such as MS-DOS.

bzip2 and bunzip2 will by default not overwrite existing files. If you want this to happen, specify the -f flag.

If no file names are specified, bzip2 compresses from standard input to standard output. In this case, bzip2 will decline to write compressed output to a terminal, as this would be entirely incomprehensible and therefore pointless.

bunzip2 (or bzip2 -d) decompresses all specified files. Files which were not created by bzip2 will be detected and ignored, and a warning issued. bzip2 attempts to guess the filename for the decompressed file from that of the compressed file as follows:


       filename.bz2    becomes   filename
       filename.bz     becomes   filename
       filename.tbz2   becomes   filename.tar
       filename.tbz    becomes   filename.tar
       anyothername    becomes   anyothername.out

If the file does not end in one of the recognised endings, .bz2, .bz, .tbz2 or .tbz, bzip2 complains that it cannot guess the name of the original file, and uses the original name with .out appended.

As with compression, supplying no filenames causes decompression from standard input to standard output.

bunzip2 will correctly decompress a file which is the concatenation of two or more compressed files. The result is the concatenation of the corresponding uncompressed files. Integrity testing (-t) of concatenated compressed files is also supported.

You can also compress or decompress files to the standard output by giving the -c flag. Multiple files may be compressed and decompressed like this. The resulting outputs are fed sequentially to stdout. Compression of multiple files in this manner generates a stream containing multiple compressed file representations. Such a stream can be decompressed correctly only by bzip2 version 0.9.0 or later. Earlier versions of bzip2 will stop after decompressing the first file in the stream.

bzcat (or bzip2 -dc) decompresses all specified files to the standard output.

bzip2 will read arguments from the environment variables BZIP2 and BZIP, in that order, and will process them before any arguments read from the command line. This gives a convenient way to supply default arguments.

Compression is always performed, even if the compressed file is slightly larger than the original. Files of less than about one hundred bytes tend to get larger, since the compression mechanism has a constant overhead in the region of 50 bytes. Random data (including the output of most file compressors) is coded at about 8.05 bits per byte, giving an expansion of around 0.5%.

As a self-check for your protection, bzip2 uses 32-bit CRCs to make sure that the decompressed version of a file is identical to the original. This guards against corruption of the compressed data, and against undetected bugs in bzip2 (hopefully very unlikely). The chances of data corruption going undetected is microscopic, about one chance in four billion for each file processed. Be aware, though, that the check occurs upon decompression, so it can only tell you that something is wrong. It can't help you recover the original uncompressed data. You can use bzip2recover to try to recover data from damaged files.

Return values: 0 for a normal exit, 1 for environmental problems (file not found, invalid flags, I/O errors, &c), 2 to indicate a corrupt compressed file, 3 for an internal consistency error (eg, bug) which caused bzip2 to panic.

OPTIONS

-c --stdout
Compress or decompress to standard output.
-d --decompress
Force decompression. bzip2, bunzip2 and bzcat are really the same program, and the decision about what actions to take is done on the basis of which name is used. This flag overrides that mechanism, and forces bzip2 to decompress.
-z --compress
The complement to -d: forces compression, regardless of the invocation name.
-t --test
Check integrity of the specified file(s), but don't decompress them. This really performs a trial decompression and throws away the result.
-f --force
Force overwrite of output files. Normally, bzip2 will not overwrite existing output files. Also forces bzip2 to break hard links to files, which it otherwise wouldn't do.

bzip2 normally declines to decompress files which don't have the correct magic header bytes. If forced (-f), however, it will pass such files through unmodified. This is how GNU gzip behaves.

-k --keep
Keep (don't delete) input files during compression or decompression.
-s --small
Reduce memory usage, for compression, decompression and testing. Files are decompressed and tested using a modified algorithm which only requires 2.5 bytes per block byte. This means any file can be decompressed in 2300k of memory, albeit at about half the normal speed.

During compression, -s selects a block size of 200k, which limits memory use to around the same figure, at the expense of your compression ratio. In short, if your machine is low on memory (8 megabytes or less), use -s for everything. See MEMORY MANAGEMENT below.

-q --quiet
Suppress non-essential warning messages. Messages pertaining to I/O errors and other critical events will not be suppressed.
-v --verbose
Verbose mode -- show the compression ratio for each file processed. Further -v's increase the verbosity level, spewing out lots of information which is primarily of interest for diagnostic purposes.
-L --license -V --version
Display the software version, license terms and conditions.
-1 (or --fast) to -9 (or --best)
Set the block size to 100 k, 200 k .. 900 k when compressing. Has no effect when decompressing. See MEMORY MANAGEMENT below. The --fast and --best aliases are primarily for GNU gzip compatibility. In particular, --fast doesn't make things significantly faster. And --best merely selects the default behaviour.
--
Treats all subsequent arguments as file names, even if they start with a dash. This is so you can handle files with names beginning with a dash, for example: bzip2 -- -myfilename.
--repetitive-fast --repetitive-best
These flags are redundant in versions 0.9.5 and above. They provided some coarse control over the behaviour of the sorting algorithm in earlier versions, which was sometimes useful. 0.9.5 and above have an improved algorithm which renders these flags irrelevant.

MEMORY MANAGEMENT

bzip2 compresses large files in blocks. The block size affects both the compression ratio achieved, and the amount of memory needed for compression and decompression. The flags -1 through -9 specify the block size to be 100,000 bytes through 900,000 bytes (the default) respectively. At decompression time, the block size used for compression is read from the header of the compressed file, and bunzip2 then allocates itself just enough memory to decompress the file. Since block sizes are stored in compressed files, it follows that the flags -1 to -9 are irrelevant to and so ignored during decompression.

Compression and decompression requirements, in bytes, can be estimated as:


       Compression:   400k + ( 8 x block size )


       Decompression: 100k + ( 4 x block size ), or
                      100k + ( 2.5 x block size )

Larger block sizes give rapidly diminishing marginal returns. Most of the compression comes from the first two or three hundred k of block size, a fact worth bearing in mind when using bzip2 on small machines. It is also important to appreciate that the decompression memory requirement is set at compression time by the choice of block size.

For files compressed with the default 900k block size, bunzip2 will require about 3700 kbytes to decompress. To support decompression of any file on a 4 megabyte machine, bunzip2 has an option to decompress using approximately half this amount of memory, about 2300 kbytes. Decompression speed is also halved, so you should use this option only where necessary. The relevant flag is -s.

In general, try and use the largest block size memory constraints allow, since that maximises the compression achieved. Compression and decompression speed are virtually unaffected by block size.

Another significant point applies to files which fit in a single block -- that means most files you'd encounter using a large block size. The amount of real memory touched is proportional to the size of the file, since the file is smaller than a block. For example, compressing a file 20,000 bytes long with the flag -9 will cause the compressor to allocate around 7600k of memory, but only touch 400k + 20000 * 8 = 560 kbytes of it. Similarly, the decompressor will allocate 3700k but only touch 100k + 20000 * 4 = 180 kbytes.

Here is a table which summarises the maximum memory usage for different block sizes. Also recorded is the total compressed size for 14 files of the Calgary Text Compression Corpus totalling 3,141,622 bytes. This column gives some feel for how compression varies with block size. These figures tend to understate the advantage of larger block sizes for larger files, since the Corpus is dominated by smaller files.


           Compress   Decompress   Decompress   Corpus
    Flag     usage      usage       -s usage     Size


     -1      1200k       500k         350k      914704
     -2      2000k       900k         600k      877703
     -3      2800k      1300k         850k      860338
     -4      3600k      1700k        1100k      846899
     -5      4400k      2100k        1350k      845160
     -6      5200k      2500k        1600k      838626
     -7      6100k      2900k        1850k      834096
     -8      6800k      3300k        2100k      828642
     -9      7600k      3700k        2350k      828642

RECOVERING DATA FROM DAMAGED FILES

bzip2 compresses files in blocks, usually 900kbytes long. Each block is handled independently. If a media or transmission error causes a multi-block .bz2 file to become damaged, it may be possible to recover data from the undamaged blocks in the file.

The compressed representation of each block is delimited by a 48-bit pattern, which makes it possible to find the block boundaries with reasonable certainty. Each block also carries its own 32-bit CRC, so damaged blocks can be distinguished from undamaged ones.

bzip2recover is a simple program whose purpose is to search for blocks in .bz2 files, and write each block out into its own .bz2 file. You can then use bzip2 -t to test the integrity of the resulting files, and decompress those which are undamaged.

bzip2recover takes a single argument, the name of the damaged file, and writes a number of files "rec00001file.bz2", "rec00002file.bz2", etc, containing the extracted blocks. The output filenames are designed so that the use of wildcards in subsequent processing -- for example, "bzip2 -dc rec*file.bz2 > recovered_data" -- processes the files in the correct order.

bzip2recover should be of most use dealing with large .bz2 files, as these will contain many blocks. It is clearly futile to use it on damaged single-block files, since a damaged block cannot be recovered. If you wish to minimise any potential data loss through media or transmission errors, you might consider compressing with a smaller block size.

PERFORMANCE NOTES

The sorting phase of compression gathers together similar strings in the file. Because of this, files containing very long runs of repeated symbols, like "aabaabaabaab ..." (repeated several hundred times) may compress more slowly than normal. Versions 0.9.5 and above fare much better than previous versions in this respect. The ratio between worst-case and average-case compression time is in the region of 10:1. For previous versions, this figure was more like 100:1. You can use the -vvvv option to monitor progress in great detail, if you want.

Decompression speed is unaffected by these phenomena.

bzip2 usually allocates several megabytes of memory to operate in, and then charges all over it in a fairly random fashion. This means that performance, both for compressing and decompressing, is largely determined by the speed at which your machine can service cache misses. Because of this, small changes to the code to reduce the miss rate have been observed to give disproportionately large performance improvements. I imagine bzip2 will perform best on machines with very large caches.

CAVEATS

I/O error messages are not as helpful as they could be. bzip2 tries hard to detect I/O errors and exit cleanly, but the details of what the problem is sometimes seem rather misleading.

This manual page pertains to version 1.0.2 of bzip2. Compressed data created by this version is entirely forwards and backwards compatible with the previous public releases, versions 0.1pl2, 0.9.0, 0.9.5, 1.0.0 and 1.0.1, but with the following exception: 0.9.0 and above can correctly decompress multiple concatenated compressed files. 0.1pl2 cannot do this; it will stop after decompressing just the first file in the stream.

bzip2recover versions prior to this one, 1.0.2, used 32-bit integers to represent bit positions in compressed files, so it could not handle compressed files more than 512 megabytes long. Version 1.0.2 and above uses 64-bit ints on some platforms which support them (GNU supported targets, and Windows). To establish whether or not bzip2recover was built with such a limitation, run it without arguments. In any event you can build yourself an unlimited version if you can recompile it with MaybeUInt64 set to be an unsigned 64-bit integer.

AUTHOR

Julian Seward, jseward@acm.org.

http://sources.redhat.com/bzip2

The ideas embodied in bzip2 are due to (at least) the following people: Michael Burrows and David Wheeler (for the block sorting transformation), David Wheeler (again, for the Huffman coder), Peter Fenwick (for the structured coding model in the original bzip, and many refinements), and Alistair Moffat, Radford Neal and Ian Witten (for the arithmetic coder in the original bzip). I am much indebted for their help, support and advice. See the manual in the source distribution for pointers to sources of documentation. Christian von Roques encouraged me to look for faster sorting algorithms, so as to speed up compression. Bela Lubkin encouraged me to improve the worst-case compression performance. The bz* scripts are derived from those of GNU gzip. Many people sent patches, helped with portability problems, lent machines, gave advice and were generally helpful.

責(zé)任編輯:韓亞珊 來(lái)源: CMPP.net
相關(guān)推薦

2011-08-24 16:48:36

man中文man

2011-08-15 10:21:09

man中文man

2011-08-15 17:41:58

bunzip2中文man

2010-06-24 10:59:11

Bzip2算法

2011-08-11 16:11:49

at中文man

2010-06-24 10:25:55

Linux Bzip2

2011-08-29 10:44:30

zic2xpm中文man

2011-08-23 15:35:03

rpm2cpio中文man

2010-06-24 10:42:42

Bzip2壓縮

2011-08-25 10:21:56

man.conf中文man

2011-08-16 10:21:13

setconsole中文man

2011-08-24 17:06:42

NOTIFY中文man

2011-08-16 09:32:01

quotaoff中文man

2011-08-23 18:05:21

ABORT中文man

2011-08-25 18:14:26

tcflow中文man

2011-08-25 16:55:26

gets中文man

2011-08-12 11:07:19

git中文man

2011-08-25 17:30:26

setbuf中文man

2011-08-15 13:14:44

rmdir中文man

2011-08-24 17:00:04

netdevice中文man
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)

aa级大片免费在线观看| 伊人久久亚洲综合| 久久男人av| 日本高清无吗v一区| 亚洲制服欧美久久| 高h放荡受浪受bl| 久久精品1区| 美女av一区二区三区| 日本丰满少妇裸体自慰| 日日狠狠久久| 欧美日韩另类在线| 日本不卡一区二区三区四区| 无码国产精品高潮久久99| 青青草精品视频| 国外成人在线视频| 欧美爱爱免费视频| 欧美极品在线观看| 精品国产一区二区三区久久久蜜月 | 久久久国产精品视频| 中文字幕日韩三级片| 亚洲福利影视| 91高清在线观看| 国产一线二线三线女| 日本日本精品二区免费| 波多野结衣一本一道| 欧美三级视频| 日韩资源在线观看| 少妇真人直播免费视频| 视频一区中文字幕精品| 欧美日韩中文一区| 不卡影院一区二区| a'aaa级片在线观看| 亚洲日本护士毛茸茸| 日韩精品不卡| 欧美18xxxxx| 成人免费毛片app| 成人国产精品久久久| 欧美人一级淫片a免费播放| 伊人成人在线| 欧美黄色片在线观看| 人与动物性xxxx| 精品毛片免费观看| 亚洲跨种族黑人xxx| 国产女人18毛片水真多18| 久久天天久久| 欧美亚洲高清一区二区三区不卡| 欧美日韩亚洲一| 日韩伦理福利| 一本久久精品一区二区| 成 年 人 黄 色 大 片大 全| 亚洲综合伊人久久大杳蕉| 中文字幕一区二区三区在线不卡 | 国模私拍视频一区| 久久中文字幕无码| 欧美激情自拍| 欧美激情国产精品| 久久久精品国产sm调教网站| 中文字幕一区二区三区乱码图片| 精品国产视频在线| 欧美特黄一级片| 99久久婷婷| 久久中文字幕在线视频| 好吊日在线视频| 自拍欧美日韩| 欧美精品videos性欧美| 国产精品第108页| 夜夜嗨av一区二区三区网站四季av| 韩国福利视频一区| 日本一区二区三区精品| 亚洲综合丁香| 国产精品jizz在线观看麻豆| 涩涩视频在线观看| 久久精品国产一区二区三 | 青青艹视频在线| 一级毛片久久久| 欧美日韩综合色| 91免费视频污| 精品精品精品| 国产一区二区三区精品久久久 | 亚洲一区欧美| 国内精品久久久久久| 69视频免费在线观看| 日本不卡在线视频| 成人女保姆的销魂服务| 亚洲不卡免费视频| 91碰在线视频| 一区二区高清视频| 欧美伦理免费在线| 在线视频中文字幕一区二区| 91国内在线播放| 成人看片爽爽爽| 在线播放日韩av| 激情四射综合网| 亚洲一区一卡| 97久久精品午夜一区二区| 天天综合永久入口| 国产精品电影一区二区| 毛片在线播放视频| 97成人超碰| 亚洲成人在线视频播放| 国产精品酒店视频| 最新日韩在线| 国产在线观看不卡| 深夜福利视频一区| 亚洲免费观看高清完整版在线观看熊| 大陆极品少妇内射aaaaa| 久久91超碰青草在哪里看| 亚洲成人精品视频| 亚洲一区电影在线观看| 国产精品免费看| 91在线免费网站| 黄色片在线免费看| 亚洲电影一区二区三区| 97超碰成人在线| 曰本一区二区三区视频| 久久91亚洲人成电影网站 | 日韩午夜精品电影| 亚洲a v网站| 悠悠资源网久久精品| 成人免费观看网址| 懂色一区二区三区| 欧美日韩亚洲一区二区| 国产精品日日摸夜夜爽| 久久综合国产| 国产成人拍精品视频午夜网站| 精品国自产在线观看| 国产精品久久午夜夜伦鲁鲁| 欧美韩国日本在线| 福利电影一区| 色综合久久久888| 11024精品一区二区三区日韩| 99re66热这里只有精品3直播 | 国产精品夜夜夜爽阿娇| 日韩影院免费视频| 欧美高清性xxxxhdvideosex| 国产一二在线播放| 欧美成人vps| 538精品在线视频| 激情欧美一区二区三区在线观看| 日韩精品电影网站| 精品日本视频| 亚洲乱码av中文一区二区| 日韩成人免费观看| 99精品视频在线播放观看| 免费特级黄色片| 99国产精品免费网站| 欧美国产第二页| 亚洲精品喷潮一区二区三区| 亚洲综合在线观看视频| 色悠悠在线视频| 亚洲日本黄色| 精品综合久久| 成人性生交大片免费观看网站| 日韩av在线免费播放| av大片在线免费观看| 97久久精品人人澡人人爽| 国产精品网站免费| 精品在线91| 国产精品久久99久久| 北岛玲一区二区三区| 欧美日韩一卡二卡三卡| 日本 欧美 国产| 国产自产v一区二区三区c| 玖玖精品在线视频| 一区二区三区亚洲变态调教大结局| 欧美黑人一区二区三区| 婷婷丁香花五月天| 色先锋aa成人| 91制片厂在线| 国产成人精品www牛牛影视| 黄色一级视频在线播放| 亚洲瘦老头同性70tv| 国产成人高清激情视频在线观看 | chinese少妇国语对白| 精品freesex老太交| 国产欧美在线视频| 青春草视频在线| 精品偷拍各种wc美女嘘嘘| 天堂av免费在线观看| 亚洲视频在线观看一区| 美女久久久久久久久| 日韩电影网1区2区| 日韩精品第1页| 日韩影视高清在线观看| 国产精品亚洲网站| 污影院在线观看| 亚洲欧美日韩在线高清直播| 国产精品久久综合青草亚洲AV| 亚洲一区欧美一区| 国产高清一区二区三区四区| 韩国成人精品a∨在线观看| 精品无码国产一区二区三区av| 国产剧情在线观看一区| 91大片在线观看| 欧美男体视频| 久久99国产精品自在自在app| 欧美性孕妇孕交| 日韩午夜小视频| 中文字幕 国产精品| 亚洲制服丝袜av| аⅴ天堂中文在线网| 成人久久视频在线观看| 天天色综合社区| 99国产精品自拍| 99精品视频网站| 深爱激情综合| 国产欧美日韩综合精品二区| 日本久久一区| 日韩av毛片网| wwwww亚洲| 久久国产一区二区三区| 国产一级免费在线观看| 日韩精品一区在线| 一本久道久久综合无码中文| 欧美日韩国产专区| 久久久久久久九九九九| 欧美国产乱子伦| 亚洲男人在线天堂| 国产99久久久久久免费看农村| 久久精品免费网站| 国产精品一二| 国产精品久久久久7777| 天天射天天综合网| 天天综合狠狠精品| 亚洲肉体裸体xxxx137| 99在线高清视频在线播放| 在线日韩三级| 国产伦精品一区二区三区精品视频| 91精品论坛| 国产91精品不卡视频| 丁香花电影在线观看完整版| 久久香蕉频线观| 麻豆视频网站在线观看| 色爱av美腿丝袜综合粉嫩av| 久久米奇亚洲| 亚洲欧美日韩精品| 欧洲免费在线视频| 精品亚洲一区二区三区| 污视频网站免费观看| 亚洲国产中文字幕久久网| 亚洲免费视频网| 欧美成人r级一区二区三区| 午夜精品无码一区二区三区| 欧美一级在线视频| a级片在线视频| 日韩欧美中文一区二区| 精品国产999久久久免费| 欧美精品色一区二区三区| 一二三区在线播放| 在线播放国产精品二区一二区四区| 中文字幕在线观看你懂的| 欧美色中文字幕| 中文字幕久久熟女蜜桃| 精品视频一区二区三区免费| 亚洲天堂avav| 3d动漫精品啪啪| 国产丝袜在线视频| 日韩精品在线网站| 天天综合在线视频| 一本色道久久综合狠狠躁篇怎么玩 | 国产一区二区看久久| 欧美国产日韩在线视频| 国产精品69毛片高清亚洲| 性活交片大全免费看| 成人黄色777网| 三级黄色片网站| 国产蜜臀97一区二区三区| 亚洲综合久久av一区二区三区| 亚洲素人一区二区| 久久国产露脸精品国产| 天天操天天综合网| 九九热最新视频| 欧美日韩免费在线视频| 午夜精品一区二区三| 亚洲精品国精品久久99热一| 久久久久久青草| 美日韩在线视频| 日韩激情电影| 成人亚洲欧美一区二区三区| 欧美美女黄色| 一区二区三区四区欧美日韩| 国产精品mm| 日韩精品一区二区三区不卡 | 福利微拍一区二区| 亚洲欧美另类在线视频| 欧美精品1区2区3区| 色丁香婷婷综合久久| 中文字幕欧美日韩| 男人天堂亚洲天堂| 国产精品久久久久久久久久三级 | 国产日产精品一区二区三区的介绍| 一区二区高清视频在线观看| 久久久成人免费视频| 91精品国产入口| 男男激情在线| 九九热这里只有精品6| 日本欧美韩国| 国产欧美韩日| 99久久夜色精品国产亚洲96 | 欧美aaa视频| 国产 高清 精品 在线 a| jizzjizz欧美69巨大| 青青青青草视频| 精品制服美女丁香| 国产女主播喷水高潮网红在线| 亚洲精品国久久99热| 亚洲精品无码久久久久| 亚洲福利影片在线| 成人免费高清| 国产精品青青在线观看爽香蕉| 欧美激情99| 中文精品无码中文字幕无码专区| 日韩av不卡一区二区| 波多野结衣福利| 亚洲一卡二卡三卡四卡无卡久久 | 欧美mv日韩mv亚洲| 免费a级人成a大片在线观看| 日本久久久a级免费| 久草在线综合| 福利视频免费在线观看| 美腿丝袜亚洲色图| 自拍偷拍视频亚洲| 欧美日韩中文字幕| 污视频在线免费观看| 精品国内自产拍在线观看| 国产精品极品美女在线观看| 欧美xxxx黑人又粗又长精品| 亚洲精品美女91| 国产亚洲精品成人a| 亚洲三级免费电影| 中文字幕在线播出| 国产一区二区三区高清在线观看| 正在播放日韩精品| 精品视频在线观看| 亚洲深夜福利| xxxx黄色片| 五月综合激情婷婷六月色窝| 亚洲精品久久久久久久久久| 欧美日本黄视频| 日日夜夜精品视频| 欧美a级免费视频| 国产91精品露脸国语对白| 妺妺窝人体色www聚色窝仙踪| 91精品国产欧美一区二区18| 黄色免费网站在线| 亚洲va久久久噜噜噜| 亚洲网色网站| 国产精品欧美性爱| 亚洲图片欧美视频| 日韩一级免费毛片| 2019精品视频| 免费看成人吃奶视频在线| 超碰影院在线观看| 中文字幕二三区不卡| 在线免费观看视频网站| 日韩中文在线观看| 精品视频成人| 国产主播自拍av| 91小视频在线| 中文字幕 国产精品| 久久久成人的性感天堂| 1769国产精品视频| 凹凸国产熟女精品视频| 久久精子c满五个校花| 中国女人一级一次看片| 久久精品91久久香蕉加勒比| 日韩精品一级| 鲁一鲁一鲁一鲁一色| 国产日韩欧美精品一区| 国产农村妇女毛片精品久久| 久久久久久国产精品久久| 亚洲精品亚洲人成在线| 在线观看av日韩| 亚洲精选视频在线| 少妇荡乳情欲办公室456视频| 日本国产精品视频| 香港欧美日韩三级黄色一级电影网站| 能看毛片的网站| 欧美日韩一区二区在线| 91成人高清| 国产精品jizz视频| 丝袜美腿高跟呻吟高潮一区| 看黄色录像一级片| 精品夜色国产国偷在线| 伊人国产精品| 奇米精品一区二区三区| 国产精品美女久久久久aⅴ国产馆| av中文在线观看| 欧美洲成人男女午夜视频| 亚洲91视频| 国内精品久久99人妻无码| 51精品国自产在线| 一二三四视频在线中文| 在线成人av电影| 久久综合av免费| 精品国产va久久久久久久| 国产成人久久久| 影音先锋亚洲电影| 国产免费美女视频| 日韩高清中文字幕|