In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor will share with you the relevant knowledge points about how to install and use pigz. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.
Pigz command can be used to extract files, the most important thing is to support multi-threaded parallel processing, decompression is faster than gzip. The time of pigz is 60% faster than that of gzip, and the consumption of CPU is several times that of gzip. Of course, the CPU utilization of pigz is also 100%.
Environment
Centos7 RAM:2GB, CPU: 4vcpus
Install # install epel extension source [root@localhost ~] # wget-O / etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo[root@localhost ~] # yum makecache# install pigz [root @ localhost ~] # yum-y install pigz how to compress files
The following are common parameters:
-p n: the number of cores used when compressing. By default, all cores are used-k: keep the source file after compression-l: list the compressed input. -6: default compression level-9: highest compression ratio, but slow speed-1: lowest compression ratio, fastest
For example: compressed file, if you need to keep the source file, you can add the parameter: FreeNAS-11.2- U7.iso``-k
[root@localhost] # pigz-k FreeNAS-11.2-U7.iso
You can use the option to view the compression ratio of the compressed file:-l
[root@localhost ~] # pigz-l FreeNAS-11.2-U7.iso.gzcompressed original reduced name576426218 602378240 4.3% FreeNAS-11.2-U7.iso
How to compress a directory
Pigz does not have the option to compress folders, you can only compress individual files. Pigz can be used with the tar command to compress folders.
[root@localhost ~] # tar-cvf-/ var/log | pigz-k > logs.tar.gz
Check the compression information:
[root@localhost ~] # pigz-l logs.tar.gzcompressed original reduced name 698038 9093120 92.3% logs.tar [root@localhost ~] #
How to extract a file
Extract a single file, decompression method:
[root@localhost test] # unpigz-d FreeNAS-11.2-U7.iso.gz# if you need to keep the source zip file, add the-k parameter [root@localhost test] # pigz-k-d FreeNAS-11.2-U7.iso.gz
Decompress a directory, decompression method:
[root@localhost test] # tar-xf logs.tar.gz above is all the content of this article "how to install and use pigz". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.