1. 前言
创作开始时间:2021年11月1日14:49:49
有时候文件夹太大(有100个G),要直接从服务器上传输到本地的话太麻烦,这时候就需要对文件夹进行压缩,我是希望压缩率高一点,这样节省空间和流量,所以这里探究lrzip这个压缩工具。
使用体验:
- 对大文件的压缩率极高,感觉挺好用的。
2. lrzip介绍
参考
LRZIP ( Long Range ZIP ) 是压缩程序,可以达到非常高的压缩率和速度较大的文件时使用。它使用zpaq和最大的压缩,最高速度的zpaq和LZMA算法压缩算法相结合,和长期范围rzip冗余减少。其目的是规模与内存大小的增加,进一步提高压缩。无论是从规模的一个选择,优化和速度都允许更好的压缩比,甚至可以提供压缩算法,比gzip或更好的速度,但用bzip2压缩级别大小。
lrzip全称:Long Range ZIP or LZMA RZIP
lrzip官网:https://github.com/ckolivas/lrzip
A compression utility that excels at compressing large files (usually > 10-50 MB). Larger files and/or more free RAM means that the utility will be able to more effectively compress your files (ie: faster / smaller size), especially if the filesize(s) exceed 100 MB. You can either choose to optimise for speed (fast compression / decompression) or size, but not both.
这里说了lrzip对大文件尤其好用。(超过10-50m,尤其是100m。)
3. 配置环境
3.1. 在ubuntu下
在ubuntu系统下非常方便:
sudo apt-get install lrzip
3.2. 在Windows下
这个稍微麻烦点。
1)先要去下载cygwin: http://www.cygwin.com/
2)安装
3)安装package:如下图,在搜索到的lrzip这行里面双击skip,然后点下一步,就会安装这个lrzip工具:
3)安装后的lrzip,如下图,已经在本地了,可以在cygwin终端进行调用/使用:
4)打开cgywin终端,发现已经可以用了!
参考:
- Part Two - Installing GCC https://warwick.ac.uk/fac/sci/moac/people/students/peter_cock/cygwin/part2/
- Installing Cygwin https://www.ibm.com/docs/en/rtr/8.2.0?topic=studio-installing-cygwin
- How do I install gcc on cygwin? https://stackoverflow.com/questions/47215330/how-do-i-install-gcc-on-cygwin/47222901
4. 压缩方法
# 压缩文件
lrzip single_file
# 压缩文件夹
lrztar single_folder
一般来说,不用绝对路径,直接打开所在文件(夹)的所在目录,打开终端运行指令就行了。
5. 解压缩方法
# 解压缩文件
lrunzip single_file
# 解压缩文件夹
lrzuntar single_folder
6. 小结
以上。
创作结束时间:2021年11月8日21:28:03
7. 参考文献
- lrzip–>linux下的多线程压缩工具 https://blog.csdn.net/qq_26819733/article/details/54563596
- Which file compression software for linux offers the highest size reduction? [closed] https://unix.stackexchange.com/questions/78262/which-file-compression-software-for-linux-offers-the-highest-size-reduction (这个文献很关键,让我发现了lrzip)
- lrztar(1) - Linux man page https://linux.die.net/man/1/lrztar
- Windows:安装cygwin教程 https://blog.csdn.net/lvsehaiyang1993/article/details/81027399 这个还是比较给力的
- cygwin官网 http://www.cygwin.com/
- Decompress lrzip on Windows https://superuser.com/questions/793959/decompress-lrzip-on-windows 这里告诉我需要安装cygwin
- How to Use Cygwin https://www.wikihow.com/Use-Cygwin