BZIP2 is a lossless compression software based on Burrows-wheeler transform, the compression effect is better than the traditional lz77/lz78 compression algorithm. It is provided free of charge with high quality data compression capability. BZIP2 use of advanced compression technology, can compress files to 10% to 15%, compression speed and decompression efficiency are very high! Supports most compression formats now, including Tar.gzip, and so on.
GZ is a compressed file in a Unix system, a GNU version of Zip, and features the same compressed files as WinRAR.
BZ2 and. GZ are all formatted as compressed files under Linux, somewhat similar to. zip and. rar files under Windows.
&http://www.aliyun.com/zixun/aggregation/37954.html ">NBSP;
The difference between bz2 and. GZ is that the former has a higher compression rate than the latter, which takes less time than the former. That is, the same file, after compression, the. bz2 file is smaller than the. gz file, but the. bz2 file is small at the cost of more time.
Compress instance: Compress a 599M folder workspace
-----------bz2 File----------------------
Time TAR-JCVF j.tar.bz2 workspace/
340M 56.8%
Real 13m20.975s
User 11m13.872s
SYS 0m5.985s
-----------GZ File----------------------
Time TAR-ZCVF z.tar.gz workspace/
348M 58.1%
Real 2m10.305s
User 0m54.228s
SYS 0m7.399s
---------------------------------
Summary: After compression, the. bz2 file is only 8M smaller than the. gz file, but it takes 6 times times more time. Of course, the compression ratio, time and compressed file format, size and other factors. Therefore, this example does not show that using GZ is more cost-effective than using bz2, but at least it can be proved that bz2 is higher than the GZ compression rate, and GZ takes less time than bz2.