bzip3
Compress files using Burrows-Wheeler algorithm
TLDR
Compress a file
Decompress a file
Decompress a file to stdout
Test the integrity of each file inside the archive file
Show the compression ratio for each file processed with detailed information
Decompress a file overwriting existing files
Display help
SYNOPSIS
bzip3 [OPTIONS] [FILES...]
bzip3 -d [OPTIONS] [FILES...]
PARAMETERS
-z, --compress
Forces compression. This is the default action if no other action is specified.
-d, --decompress
Decompresses the specified files. Recognizes files with the .bz3 extension.
-t, --test
Tests the integrity of the specified compressed files without decompressing them.
-k, --keep
Keeps (does not delete) input files after compression or decompression. By default, input files are removed.
-f, --force
Forces overwrite of existing output files. Also forces compression/decompression of files that do not have the standard suffix.
-c, --stdout
Compresses or decompresses to standard output. No files are deleted. Useful for piping with other commands.
-o <file>, --output <file>
Specifies the output file name. Can only be used when processing a single input file.
-j <num>, --threads <num>
Sets the number of parallel threads to use for compression/decompression. A value of 0 typically uses all available logical cores.
-l <level>, --level <level>
Sets the compression level, from 0 (fastest, less compression) to 9 (slowest, best compression). Default is often 6 or 7.
--fast
Equivalent to -l1, prioritizing speed over compression ratio.
--best
Equivalent to -l9, prioritizing the best possible compression ratio.
-v, --verbose
Increases verbosity, displaying more information about the compression/decompression process.
-S <suffix>, --suffix <suffix>
Specifies the suffix for compressed files. The default suffix is .bz3.
-h, --help
Displays a help message and exits.
-V, --version
Displays version information and exits.
DESCRIPTION
bzip3 is a modern file compression utility designed to surpass the performance of its predecessor, bzip2, and often compete with or exceed xz in terms of speed while maintaining excellent compression ratios. Unlike bzip2 which uses the Burrows-Wheeler Transform, bzip3 typically leverages more advanced algorithms like LZMA2, often combined with a fast hash table for block processing. It is built with multi-threading capabilities from the ground up, allowing it to significantly speed up compression and decompression tasks on multi-core processors. The command can be used to compress files, decompress .bz3 archives, test the integrity of compressed files, and stream data to or from standard output. By default, bzip3 replaces the original file with the compressed or decompressed version, but this behavior can be altered with options.
CAVEATS
bzip3 is a relatively new compression utility compared to well-established tools like gzip or bzip2. As such, it may not be pre-installed on all Linux distributions by default, and its compression format (.bz3) is not as widely supported by other archiving tools or systems. While it offers excellent performance, its adoption might not be as widespread as older formats. Always ensure the recipient of .bz3 files has bzip3 installed to decompress them.
DEFAULT BEHAVIOR
When compressing, bzip3 creates a new file with a .bz3 suffix and by default deletes the original input file. When decompressing, it creates the original file and deletes the .bz3 archive. This behavior can be overridden using the -k (--keep) option.
COMPRESSION RATIO AND SPEED
bzip3 is designed to offer a superior balance between compression ratio and speed compared to bzip2, often achieving better compression than gzip and competitive ratios with xz, but with significantly faster execution times, especially on systems with multiple CPU cores, due to its multi-threaded architecture.
HISTORY
bzip3 emerged as a modern initiative to address the limitations of older compression algorithms, particularly bzip2, which is single-threaded and can be slow. Developed to leverage contemporary multi-core processor architectures, bzip3 utilizes advanced compression algorithms, notably LZMA2, to achieve higher compression ratios and significantly faster speeds through parallel processing. Its development focuses on providing a powerful, efficient, and user-friendly alternative for file compression in the Linux ecosystem, aiming to become the go-to utility for general-purpose archiving where speed and ratio are critical.