bzip2 Compression Format
Common on Linux for compressed tarballs and package sources. Block header + CRC footer structure; decompression bombs are a security concern like gzip/zip.
What It Defines
Block-sorting compression format: `BZh` magic + digit (block size), then Burrows-Wheeler transformed and Huffman-coded blocks with CRCs. Typically single-stream (`.bz2`), distinct from tar archives (`.tar.bz2` is tar envelope + bzip2 compression). MIME type: `application/x-bzip2`.
Canonical (Normative)
Convenient (Practical)
Non-profit hosting Linux kernel development and hundreds of open-source projects. Maintains the Linux Standard Base (LSB) for binary-compatible Linux distributions, hosts the ELF reference specifications and System V ABI documents, and stewards ELISA, OpenEmbedded, Zephyr, and other embedded/safety-critical Linux initiatives.
Related Specs
`.gz` files, HTTP Content-Encoding: gzip, and tarball distribution (`.tar.gz`) all depend on this format. Know header vs raw DEFLATE stream.
ZIP is everywhere — downloads, backups, Java JARs, Office Open XML. Central-directory-at-end structure, path traversal (`../../`), and zip bombs are critical security concerns.
Docker layers, npm pack, Linux package sources, and backup workflows use tar. ustar and PAX extensions define long filenames and metadata.
7z often achieves better compression than ZIP/gzip. Understanding stream/header separation helps when debugging extraction tools and archive security policies.