pbzip2(1)

๐Ÿ“ฆ version 1.1.13, in opensuse-leap 16.0

๐Ÿ’– pbzip2 ๐Ÿ’–

the parallel bzip2 file compressor, v1.1.10 โ€” she's fast, she's multithreaded, she's your new bestie ๐Ÿฆ‹


โœจ NAME โœจ

pbzip2</purl> โ€” parallel bzip2 file compressor, v1.1.10. no cap, that's literally her whole thing ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

pbzip2 [ -123456789 ] [ -b#cdfhklm#p#qrS#tvVz ] [ filenames ...  ]

like... give her some flags, give her some files, she'll handle it ๐Ÿซถ


๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so bestie, here's the tea โ˜•

pbzip2 is a parallel implementation of the bzip2 block-sorting file compressor that uses pthreads and achieves near-linear speedup on SMP machines. and the way that it's fully compatible with bzip2 v1.0.2 or newer?? iconic. like, literally anything compressed with pbzip2 can be decompressed with bzip2. no drama, no beef, they're besties ๐Ÿซถ

pbzip2 should work on any system that has a pthreads compatible C++ compiler (such as gcc). it has been tested on: Linux, Windows (cygwin), Solaris, Tru64/OSF1, HP-UX, and Irix. she gets around ๐Ÿ’…โœจ

the default settings for pbzip2 will work well in most cases. the only switch you will likely need to use is -d to decompress files and -p to set the # of processors for pbzip2 to use if autodetect is not supported on your system, or you want to use a specific # of CPUs. that's it. that's the whole vibe check ๐Ÿฆ‹


๐Ÿ’… OPTIONS ๐Ÿ’…

  • -b# โ€” where # is block size in 100k steps (default 9 = 900k) ๐Ÿ“
  • -c, --stdout โ€” output to standard out (stdout). straight to the screen, no file, no notes โœจ
  • -d, --decompress โ€” decompress file ๐Ÿ”“
  • -f, --force โ€” force, overwrite existing output file. she said move ๐Ÿ’€
  • -h, --help โ€” print this help message ๐Ÿ™‹
  • -k, --keep โ€” keep input file, do not delete. emotionally attached, respect it ๐Ÿ’–
  • -l, --loadavg โ€” load average determines max number processors to use ๐Ÿ“ˆ
  • -m# โ€” where # is max memory usage in 1MB steps (default 100 = 100MB) ๐Ÿง 
  • -p# โ€” where # is the number of processors (default: autodetect) ๐Ÿ‘‘
  • -q, --quiet โ€” quiet mode (default). she's not talking, she's working ๐Ÿคซ
  • -r, --read โ€” read entire input file into RAM and split between processors ๐Ÿƒ
  • -S# โ€” child thread stack size in 1KB steps (default stack size if unspecified) ๐Ÿ“š
  • -t, --test โ€” test compressed file integrity ๐Ÿงช
  • -v, --verbose โ€” verbose mode. now she's yapping (affectionate) ๐Ÿ—ฃ๏ธ
  • -V โ€” display version info for pbzip2 then exit โœŒ๏ธ
  • -z, --compress โ€” compress file (default) ๐Ÿ—œ๏ธ
  • -1, --fast ... -9, --best โ€” set BWT block size to 100k .. 900k (default 900k) ๐ŸŒˆ
  • --ignore-trailing-garbage=# โ€” ignore trailing garbage flag (1 - ignored; 0 - forbidden) ๐Ÿ—‘๏ธ

if no file names are given, pbzip2 compresses or decompresses from standard input to standard output. periodt ๐Ÿ’…


๐Ÿฆ‹ FILE SIZES ๐Ÿฆ‹

you should be able to compress files larger than 4GB with pbzip2. yeah. big girl energy ๐Ÿ‘‘

files that are compressed with pbzip2 are broken up into pieces and each individual piece is compressed. this is how pbzip2 runs faster on multiple CPUs since the pieces can be compressed simultaneously. the final .bz2 file may be slightly larger than if it was compressed with the regular bzip2 program due to this file splitting (usually less than 0.2% larger). files that are compressed with pbzip2 will also gain considerable speedup when decompressed using pbzip2. trade-off queen ๐ŸŽ€

heads up bestie: files that were compressed using bzip2 will not see speedup since bzip2 packages the data into a single chunk that cannot be split between processors. she can't split what's already one blob ๐Ÿ˜ญ

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

Example 1: pbzip2 myfile.tar

this example will compress the file "myfile.tar" into the compressed file "myfile.tar.bz2". it will use the autodetected # of processors (or 2 processors if autodetect not supported) with the default file block size of 900k and default BWT block size of 900k. the classic. the standard. she ate ๐Ÿฝ๏ธ

Example 2: pbzip2 -b15k myfile.tar

this example will compress the file "myfile.tar" into the compressed file "myfile.tar.bz2". it will use the autodetected # of processors (or 2 processors if autodetect not supported) with a file block size of 1500k and a BWT block size of 900k. the file "myfile.tar" will not be deleted after compression is finished. she's keeping it ๐Ÿ’–

Example 3: pbzip2 -p4 -r -5 myfile.tar second*.txt

this example will compress the file "myfile.tar" into the compressed file "myfile.tar.bz2". it will use 4 processors with a BWT block size of 500k. the file block size will be the size of "myfile.tar" divided by 4 (# of processors) so that the data will be split evenly among each processor. this requires you have enough RAM for pbzip2 to read the entire file into memory for compression. Pbzip2 will then use the same options to compress all other files that match the wildcard "second*.txt" in that directory. multi-file slay โœจ

Example 4: tar cf myfile.tar.bz2 --use-compress-prog=pbzip2 dir_to_compress/

Example 4: tar -c directory_to_compress/ | pbzip2 -c > myfile.tar.bz2

these examples will compress the data being given to pbzip2 via pipe from TAR into the compressed file "myfile.tar.bz2". it will use the autodetected # of processors (or 2 processors if autodetect not supported) with the default file block size of 900k and default BWT block size of 900k. TAR is collecting all of the files from the "directory_to_compress/" directory and passing the data to pbzip2 as it works. teamwork makes the dream work ๐Ÿซถ

Example 5: pbzip2 -d -m500 myfile.tar.bz2

this example will decompress the file "myfile.tar.bz2" into the decompressed file "myfile.tar". it will use the autodetected # of processors (or 2 processors if autodetect not supported). it will use a maximum of 500MB of memory for decompression.

lowkey important: the switches -b, -r, and -1..-9 are not valid for decompression. they literally don't apply, don't try it ๐Ÿ™ˆ

Example 6: pbzip2 -dc myfile.tar.bz2 | tar x

this example will decompress and untar the file "myfile.tar.bz2" piping the output of the decompressing pbzip2 to tar. one line, two jobs, main character energy ๐Ÿ‘‘

Example 7: pbzip2 -c < myfile.txt > myfile.txt.bz2

this example will read myfile.txt from standard input compressing it to standard output which is redirected to to myfile.txt.bz2. (yes, the original really does say "to to". she's quirky like that ๐Ÿ’€)


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

bzip2(1) gzip(1) lzip(1) rzip(1) zip(1)

the whole squad, honestly. go say hi ๐ŸŒธ


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Jeff Gilchrist

http://compression.ca


and that's the whole page bestie!! ๐ŸŽ€โœจ written by Jeff Gilchrist over at http://compression.ca, pbzip2 version v1.1.10, living in the General Commands Manual section. go compress something big, you got this ๐Ÿ’–๐Ÿฆ‹๐Ÿ’…

๐Ÿ“ฆ where this page comes from