Learning field: differences between linux.bz2and .gz files

Source: Internet
Author: User
Article Title: learning field: differences between .bz2and .gz files under linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

. Bz2 and. Gz is the format of compressed files in linux, a bit similar to that in windows. Zip and. Rarfile.

. Bz2 and. The difference between gz and gz is that the former has a higher compression ratio than the latter, and the latter takes less time than the former. That is to say, the same file is compressed ,. Bz2 file ratio. The gz file is smaller,. The small size of the bz2 file is at the cost of more time.

Compressing an instance: compressing a 599M folder workspace

Bz2 File

Time tar-jcvf j.tar.bz2 workspace/

340 M 56.8%

Real 13m20. 975 s

User 11m13. 872 s

Sys 0m5. 985 s

Gz File

Time tar-zcvf z.tar.gz workspace/

348 M 58.1%

Real 2m10. 305 s

User 0m54. 228 s

Sys 0m7. 399 s

Conclusion: after compression ,. Bz2 file only. The gz file is 8 Mb smaller, but it takes more than 6 times the latter time. Of course, the compression ratio and time are related to the format and size of the compressed file. Therefore, this example does not indicate that it is more cost-effective to use gz than to use bz2, but at least it can be proved that bz2 is more compressed than gz, and gz is less time-consuming 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.