美文网首页
pigz在centos下的编译安装

pigz在centos下的编译安装

作者: 夕颜00 | 来源:发表于2020-05-28 13:50 被阅读0次

    1、查看版本

    $ cat /etc/redhat-release 
    CentOS Linux release 7.5.1804 (Core)
    

    pigz是压缩命令gzip的并行版,默认线程数是cpu个数。在centos7中可以用yum安装,在centos6,yum源中没有找到,使用下面的命令安装:
    1、安装基础包:
    sudo yum install zlib-devel gcc gcc-c++ -y
    2、下载pigz包:
    wget http://www.zlib.net/pigz/pigz-2.4.tar.gz
    3、解压,编译:
    tar xvf pigz-2.4.tar.gz
    cd pigz-2.4
    make
    echo $?

    ln -s /etc/yum.repos.d/pigz-2.4/pigz /bin/pigz

    4、验证:

    ]$ pigz
    Usage: pigz [options] [files ...]
      will compress files in place, adding the suffix '.gz'. If no files are
      specified, stdin will be compressed to stdout. pigz does what gzip does,
      but spreads the work over multiple processors and cores when compressing.
    
    Options:
      -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```

    相关文章

      网友评论

          本文标题:pigz在centos下的编译安装

          本文链接:https://www.haomeiwen.com/subject/rxvxzhtx.html