bzip3(1) | General Commands Manual | bzip3(1) |
bzip3 - an efficient statistical file compressor and spiritual successor to bzip2
bzip3 [ -BbcdehftV ] [ filenames ... ]
bz3cat is equivalent to bzip3 -dc
bunzip3 is equivalent to bzip3 -d
Compress or decompress a file using run length encoding and Lempel Ziv prediction, followed by the Burrows-Wheeler transform and arithmetic coding. bzip3, like its ancestor bzip2, excels at compressing text or source code.
The command-line options are deliberately very similar to those of bzip2, but they are not identical.
bzip3 expects at most two filenames intertwined with flags. bzip3 will by default not overwrite existing files. If this behaviour is intended, use the -f flag.
If no file names are specified, bzip3 will compress from standard input to standard output, refusing to output binary data to a terminal. The -e flag (encode) is implied.
bunzip3 (or, bzip3 -d equivalently) decompresses data from standard input to the standard output, refusing to read from a terminal.
If two files are specified, the first one is used in place of standard input, and the second one is used in place of standard output.
If the -c flag is present, bzip3 will read from the specified file and output data to standard output instead. Otherwise, if decoding, bzip3 will try to guess the decompressed filename by removing the .bz3 extension. If not present, an error will be reported. If encoding, the output filename will be generated by appending the .bz3 extension to the input filename.
Compression is performed as long as the input block is longer than 64 bytes. Otherwise, it's coded as a literal block. In all other cases, the compressed data is written to the file. The file format has constant overhead of 9 bytes per file and from 9 to 17 bytes per block. Random data is coded so that expansion is generally under 0.8%.
bzip3 uses 32-bit CRC to ensure that the decompressed version of a file is identical to the original. This guards against corruption of the compressed data.
The -b flag sets the block size in mebibytes (MiB). The default is 16 MiB. Compression and decompression memory usage can be estimated as:
6 x block size
Larger block sizes usually give rapidly diminishing returns. It is also important to appreciate that the decompression memory requirement is set at compression time by the choice of block size. In general, try and use the largest block size memory constraints allow, since that maximises the compression achieved. Compression and decompression speed are virtually unaffected by block size.
Kamila Szewczyk, kspalaiologos@gmail.com.
https://github.com/kspalaiologos/bzip3
Thanks to: Ilya Grebnov, Benjamin Strachan, Caleb Maclennan, Ilya Muravyov, package maintainers - Leah Neukirchen, Grigory Kirillov, Maciej Barc, Robert Schutz, Petr Pisar, and others. Also everyone who sent patches, helped with portability problems, encouraged me to work on bzip3 and lent me machines for performance tests.
version v1.2.2 |