LinuxCommandLibrary

deflate

Decompress files compressed with the deflate algorithm

SYNOPSIS

deflate [-c] [-d] [-l LEVEL] [-p PARALLELISM] [-t] [-v] [-V] [-h] [FILE]…

PARAMETERS

-c, --stdout
    Write output on standard output; keep input files unchanged.

-d, --decompress, --uncompress
    Decompress files (or stdin if FILE is -). Removes .deflate suffix.

-l LEVEL, --level=LEVEL
    Compression level 1-12 (default 6). 1=fastest/lowest, 12=slowest/best ("ultra" 10-12 exclusive to libdeflate). Ignored for decompression.

-p PARALLELISM, --parallelism=PARALLELISM
    Compression threads: 1 to CPU cores (default 1). Decompression is single-threaded.

-t, --test
    Test integrity of compressed files; print uncompressed size, no output.

-v, --verbose
    Print verbose info (sizes, speeds) to stderr.

-V, --version
    Print version and exit.

-h, --help
    Print help and exit.

DESCRIPTION

The deflate command is a command-line utility from the libdeflate-tools package, designed for fast compression and decompression using the raw DEFLATE algorithm—the core compression method behind gzip, ZIP, PNG, and HTTP deflate. Powered by the high-performance libdeflate library, it significantly outperforms traditional zlib implementations, especially for single-threaded compression at standard levels (1-9) and offers exclusive ultra levels (10-12) for superior ratios at higher CPU cost.

It supports stdin/stdout processing, multi-file handling (appending .deflate suffix to outputs), parallel compression threads, integrity testing, and verbose output. Decompression ignores compression levels and is always single-threaded. Ideal for web servers needing raw DEFLATE streams, data archiving without headers, or benchmarks. Install via libdeflate-tools package on most distros; not a core utility.

CAVEATS

Produces raw DEFLATE streams only (no gzip/zlib headers). Not compatible with gzip, unzip, etc. Requires libdeflate-tools package. Parallelism limited to compression; ultra levels slower than standard 9.

FILE HANDLING

Multiple FILEs compress to FILE.deflate; decompression strips suffix. Use - for stdin/stdout.

PERFORMANCE NOTES

Up to 2x faster compression than zlib at level 6; ultra levels rival zstd ratios but DEFLATE-compatible.

HISTORY

Developed by Eric Biggers as part of libdeflate library (initial release 2016). Command-line tools deflate/inflate added in v1.0 (2020), focusing on speed optimizations over zlib. Widely used in modern distros for performance-critical tasks.

SEE ALSO

gzip(1), pigz(1), zlib-flate(1), inflate(1)

Copied to clipboard