← 返回命令列表

Linux command

pbzip2 命令

网络

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

常用示例

Compress file

pbzip2 [file]

Decompress file

pbzip2 -d [file.bz2]

Keep original file

pbzip2 -k [file]

Set compression level

pbzip2 -[9] [file]

Use specific number of processors

pbzip2 -p[4] [file]

Compress from stdin

cat [file] | pbzip2 > [file.bz2]

Decompress to stdout

pbzip2 -dc [file.bz2] > [file]

Test compressed file

pbzip2 -t [file.bz2]

说明

pbzip2 is a parallel implementation of bzip2 compression. It uses multiple CPU cores to compress and decompress files faster than single-threaded bzip2. The tool produces files compatible with standard bzip2. Output can be decompressed by bzip2, bunzip2, or pbzip2 itself. Parallelism scales with available processors. By default, all cores are used. The -p flag limits processor usage for background compression. Compression levels work like bzip2: higher numbers produce smaller files but take longer. The parallel implementation helps offset slower compression speeds. Memory usage scales with thread count. Each thread needs memory for its compression buffer. Limits can prevent memory exhaustion on large jobs. Pipe mode supports streaming compression. Combined with tar, it enables parallel compressed archives.

参数

-d
Decompress.
-z
Compress (default).
-k
Keep original files.
-p _N_
Number of processors to use.
-1 to -9
Compression level (9 = best).
-c
Output to stdout.
-f
Force overwrite.
-t
Test integrity.
-q
Quiet mode.
-v
Verbose mode.
-m _N_
Memory limit per thread (MB).
-r
Read entire file into RAM.

FAQ

What is the pbzip2 command used for?

pbzip2 is a parallel implementation of bzip2 compression. It uses multiple CPU cores to compress and decompress files faster than single-threaded bzip2. The tool produces files compatible with standard bzip2. Output can be decompressed by bzip2, bunzip2, or pbzip2 itself. Parallelism scales with available processors. By default, all cores are used. The -p flag limits processor usage for background compression. Compression levels work like bzip2: higher numbers produce smaller files but take longer. The parallel implementation helps offset slower compression speeds. Memory usage scales with thread count. Each thread needs memory for its compression buffer. Limits can prevent memory exhaustion on large jobs. Pipe mode supports streaming compression. Combined with tar, it enables parallel compressed archives.

How do I run a basic pbzip2 example?

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

What does -d do in pbzip2?

Decompress.