August 26, 2003

bzip2和gzip的比较

  Jeremy Zawodny 最新的测试发现bzip2有更高的压缩比,但有非常明显的时间开销,无论是在压缩时还是在解压时。

gzip3d.png  他分别用了gzip和bzip2,并各自带了命令行参数"-9",压缩一个2,661,512 (or 2.5GB)字节的文件,然后解压缩,并将这个过程重复了一次,得结果如下:

压缩用时压缩后文件大小解压用时
gzip 14:31 349,736 0:55
bzip2 39:44 275,344 9:46

  他的结论是,在需要频繁解压缩的时侯,慎用bzip2.

  就我自己而言,bzip2用得远比gzip少,以后还真得学着用用了。下面将两者的帮助列在后面。

gzip 1.3
(1999-12-21)
usage: gzip [-cdfhlLnNrtvV19] [-S suffix] [file ...]
-c --stdout write on standard output, keep original files unchanged
-d --decompress decompress
-f --force force overwrite of output file and compress links
-h --help give this help
-l --list list compressed file contents
-L --license display software license
-n --no-name do not save or restore the original name and time stamp
-N --name save or restore the original name and time stamp
-q --quiet suppress all warnings
-r --recursive operate recursively on directories
-S .suf --suffix .suf use suffix .suf on compressed files
-t --test test compressed file integrity
-v --verbose verbose mode
-V --version display version number
-1 --fast compress faster
-9 --best compress better
file... files to (de)compress. If none given, use standard input.

bzip2, a block-sorting file compressor. Version 1.0.1, 23-June-2000.

usage: bzip2 [flags and input files in any order]

-h --help print this message
-d --decompress force decompression
-z --compress force compression
-k --keep keep (don't delete) input files
-f --force overwrite existing output files
-t --test test compressed file integrity
-c --stdout output to standard out
-q --quiet suppress noncritical error messages
-v --verbose be verbose (a 2nd -v gives more)
-L --license display software version & license
-V --version display software version & license
-s --small use less memory (at most 2500k)
-1 .. -9 set block size to 100k .. 900k

If invoked as `bzip2', default action is to compress.
as `bunzip2', default action is to decompress.
as `bzcat', default action is to decompress to stdout.

If no file names are given, bzip2 compresses or decompresses
from standard input to standard output. You can combine
short flags, so `-v -4' means the same as -v4 or -4v, &c.

Posted by Hilton at August 26, 2003 05:12 PM | TrackBack
Comments

是啊,好文章啊

Posted by: GOOGLE排名 at January 15, 2004 04:25 PM

bzip2我么有用过!
gzip经常用
最常用的是tar
我总觉得linux这一点不太好。有一个标准的就行了!
太多反而乱!
干什么都要查帮助!不可能吧这么多的全记住!

Posted by: google at January 14, 2004 01:25 PM

Hello

Posted by: eMule at January 13, 2004 11:03 PM

这对我来说,很有用

Posted by: 区区 at January 4, 2004 03:05 PM

linux里这两个用的还可以。

Posted by: QQ吧精彩 at December 30, 2003 12:47 PM
Post a comment









Remember personal info?