良许Linux教程网 干货合集 Linux常用命令—pigz命令

Linux常用命令—pigz命令

Linux常用命令pigz命令可以用来解压缩文件,最重要的是支持多线程并行处理,解压缩比gzip快,下面良许教程网为大家分享一下Linux常用命令—pigz命令具体使用方法。

Linux常用命令—pigz命令

pigz

可以用来解压缩文件,gzip的并行实现升级版

语法

 pigz [ -cdfhikKlLmMnNqrRtz0..9,11 ] [ -b blocksize ] [ -p threads ] [ -S suffix ] [ name ...  ]
 unpigz [ -cfhikKlLmMnNqrRtz ] [ -b blocksize ] [ -p threads ] [ -S suffix ] [ name ...  ]

参数

 -0 to -9, -11       # Compression level (level 11, zopfli, is much slower)
 --fast, --best      # Compression levels 1 and 9 respectively
 -b, --blocksize mmm # Set compression block size to mmmK (default 128K)
 -c, --stdout        # Write all processed output to stdout (won't delete)
 -d, --decompress    # Decompress the compressed input
 -f, --force         # Force overwrite, compress .gz, links, and to terminal
 -F  --first         # Do iterations first, before block split for -11
 -h, --help          # Display a help screen and quit
 -i, --independent   # Compress blocks independently for damage recovery
 -I, --iterations n  # Number of iterations for -11 optimization
 -J, --maxsplits n   # Maximum number of split blocks for -11
 -k, --keep          # Do not delete original file after processing
 -K, --zip           # Compress to PKWare zip (.zip) single entry format
 -l, --list          # List the contents of the compressed input
 -L, --license       # Display the pigz license and quit
 -m, --no-time       # Do not store or restore mod time
 -M, --time          # Store or restore mod time
 -n, --no-name       # Do not store or restore file name or mod time
 -N, --name          # Store or restore file name and mod time
 -O  --oneblock      # Do not split into smaller blocks for -11
 -p, --processes n   # Allow up to n compression threads (default is the number of online processors, or 8 if unknown)
 -q, --quiet         # Print no messages, even on error
 -r, --recursive     # Process the contents of all subdirectories
 -R, --rsyncable     # Input-determined block locations for rsync
 -S, --suffix .sss   # Use suffix .sss instead of .gz (for compression)
 -t, --test          # Test the integrity of the compressed input
 -v, --verbose       # Provide more verbose output
 -V  --version       # Show the version of pigz
 -Y  --synchronous   # Force output file write to permanent storage
 -z, --zlib          # Compress to zlib (.zz) instead of gzip format
 --                  # All arguments after "--" are treated as files

实例

可以结合tar使用, 压缩命令

 tar -cvf - dir1 dir2 dir3 | pigz -p 8 > output.tgz

解压命令

 pigz -p 8 -d output.tgz

如果是gzip格式,也支持用tar解压

 tar -xzvf output.tgz

总结

至此关于Linux常用命令pigz命令的使用方法分享结束,大家如果对pigz命令的使用方法还有问题可以通过评论区将问题提交我们。

以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你!

137e00002230ad9f26e78-265x300

本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部