← 返回命令列表

Linux command

pigz 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Compress file using multiple processors

pigz [file]

Decompress file

pigz -d [file.gz]

Compress with specific compression level

pigz -[9] [file]

Compress keeping original file

pigz -k [file]

Compress with specific number of threads

pigz -p [4] [file]

Compress to stdout

pigz -c [file] > [file.gz]

Compress files recursively in a directory

pigz -r [directory/]

Test compressed file integrity

pigz -t [file.gz]

说明

pigz (Parallel Implementation of GZip) compresses files using multiple processors. It produces gzip-compatible output significantly faster than standard gzip on multi-core systems. Compression is parallelized by dividing input into blocks processed by separate threads. The results are combined maintaining gzip compatibility. Decompression is less parallelizable but still benefits from parallel CRC checking. The default thread count matches available processors. On high-core systems, diminishing returns may occur beyond 8-16 threads. Block size affects parallelism granularity. Compression levels work like gzip: 1 (fastest) to 9 (best). Level 11 enables zopfli compression for maximum compression at much slower speed, useful for files compressed once and served many times. The tool is a drop-in replacement for gzip in most scenarios. Output format is identical, so files can be decompressed with standard gunzip.

参数

-d, --decompress
Decompress.
-k, --keep
Keep original file.
-c, --stdout
Write to stdout.
-p _NUM_, --processes _NUM_
Number of compression threads.
-# (0-9, 11)
Compression level (6 default, 11 = zopfli).
-f, --force
Force compression even if file exists.
-r, --recursive
Process directories recursively.
-t, --test
Test compressed file integrity.
-l, --list
List compression info.
-n, --no-name
Don't store original name/time.
-N, --name
Store original name/time.
-b _SIZE_, --blocksize _SIZE_
Block size for compression.
-z, --zlib
Compress to zlib format.
-K, --zip
Compress to single-entry zip.
-q, --quiet
Quiet mode.
-v, --verbose
Verbose mode.

FAQ

What is the pigz command used for?

pigz (Parallel Implementation of GZip) compresses files using multiple processors. It produces gzip-compatible output significantly faster than standard gzip on multi-core systems. Compression is parallelized by dividing input into blocks processed by separate threads. The results are combined maintaining gzip compatibility. Decompression is less parallelizable but still benefits from parallel CRC checking. The default thread count matches available processors. On high-core systems, diminishing returns may occur beyond 8-16 threads. Block size affects parallelism granularity. Compression levels work like gzip: 1 (fastest) to 9 (best). Level 11 enables zopfli compression for maximum compression at much slower speed, useful for files compressed once and served many times. The tool is a drop-in replacement for gzip in most scenarios. Output format is identical, so files can be decompressed with standard gunzip.

How do I run a basic pigz example?

Run `pigz [file]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -d, --decompress do in pigz?

Decompress.