grep -rl "compression" ./blog

Linux Compression and Archives

tar, gzip, bzip2, xz, and zip: what each format is good at, how the tools differ, and which to reach for when size or speed matters.

8 articles

zstd and 7-Zip on Linux: Fast Modern Compression Explained zstd has become the default compressor for packages, filesystems, and kernels because it is fast at every level. How to use zstd and tar --zstd, choose levels, use long-range mode, and when 7-Zip and its .7z format make more sense. EROFS Explained: The Read-Only Filesystem Behind Android and Containers How EROFS achieves random access on compressed data, why it replaced SquashFS for Android system images and container layers, and the LZ4 rolling decompression issue in Linux 7.3. bzip2 Explained bzip2 sits between gzip and xz in the compression tradeoff, offering better ratios than gzip at slower speed using the Burrows-Wheeler transform. This guide covers usage, how it compares to gzip and xz, and where it still makes sense today. gzip Explained gzip is the most widely used compression tool on Linux, balancing speed and compression ratio for everyday use. This guide covers basic usage, compression levels, how it compares to bzip2 and xz, and its role in tar.gz archives and HTTP compression. The tar Command Explained tar is the standard Linux tool for bundling files into a single archive, and it can compress that archive at the same time using gzip, bzip2, or xz. This guide covers core tar flags, common archive formats, and practical create/extract/list examples. The unzip Command Explained unzip extracts .zip archives on Linux, with options to list contents first, extract to a specific directory, and handle password-protected or partially corrupted archives. This guide covers the practical day-to-day usage. xz Compression Explained xz achieves the best compression ratio of the common Linux compressors, at the cost of being the slowest to compress. This guide covers usage, multi-threaded compression, and why xz has become the default for software release archives. The zip Command Explained zip is the cross-platform archive format most useful when files need to be shared with Windows or macOS users. This guide covers basic usage, password protection, recursive archiving, and how zip differs from the tar-plus-compressor approach common on Linux.