Linux system compression packs-analysis of differences between bz2 and. gz files

Source: Internet
Author: User
Keywords Difference linux .bz2 .gz file compressed package
Tags .gz advanced analysis based bzip2 data difference differences

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.