本文共 1443 字,大约阅读时间需要 4 分钟。
bzip2 gzip压缩率
Compress/uncompress are frequent operations. The normal for compressing/uncompressing in is gzip, bzip2, 7z, rar and zip. This post introduces how to compress and uncompress file in Linux using these tools. We use best compressing rate with all these tools and mark the options for “best rate” in bold fonts. We can delete these options if we don’t so care about the size of the compressed file and want a faster compressing.
压缩/解压缩是经常的操作。 在压缩/解压缩的常规是gzip,bzip2、7z,rar和zip。 这篇文章介绍了如何使用这些工具在Linux中压缩和解压缩文件。 我们使用所有这些工具的最佳压缩率,并以粗体标记“最佳率”的选项。 如果我们不太在意压缩文件的大小并希望更快地进行压缩,则可以删除这些选项。
The example we use here is to compress a directory dir recursively into a compressed file with particular file extension which specifies the compressing method.
我们在此使用的示例是将目录dir递归压缩为具有特定文件扩展名的压缩文件,该文件扩展名指定了压缩方法。
Compress
压缩
gzip -r --best -c dir > ./dir.gz
Uncompress
解压
gunzip ./dir.gz
Compress
压缩
tar -c dir | bzip2 --best -c > ./dir.tar.bz2
Uncompress
解压
tar xf ./dir.tar.bz2
Compress
压缩
7za -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on a ./dir.7z dir
Uncompress
解压
7za x ./dir.7z
Compress
压缩
rar -m5 a ./dir.rar dir
Uncompress
解压
rar x ./dir.rar
Compress
压缩
zip -r -9 ./dir.zip dir
Uncompress
解压
unzip ./dir.zip
We can delete the options in black fonts for faster compressing and shorter command line instead of best compressing rate.
我们可以删除黑色字体中的选项,以加快压缩速度并缩短命令行,而不是获得最佳压缩率。
翻译自:
bzip2 gzip压缩率
转载地址:http://ufowd.baihongyu.com/