Zstd

Zstandard, also known as zstd, is a fast lossless compression algorithm. It offers both excellent compression ratios and high-speed compression and decompression. Zstandard is designed to be highly versatile, suitable for a wide range of applications from data compression to streaming and archiving.

Features

High Compression Ratios

Zstandard achieves competitive compression ratios compared to other compression algorithms like gzip, lz4, and xz. It offers the flexibility to adjust compression levels according to specific requirements, balancing between speed and compression efficiency.

High-Speed Compression and Decompression

One of the key strengths of Zstandard is its impressive speed. It is optimized for both compression and decompression, making it suitable for scenarios where fast processing is essential, such as real-time data streaming and high-performance computing.

Streaming Compression

Zstandard supports streaming compression and decompression, allowing data to be compressed or decompressed in chunks without needing to hold the entire dataset in memory. This feature is particularly useful for applications dealing with large datasets or continuous streams of data.

Dictionary Compression

Zstandard includes support for dictionary compression, where a predefined dictionary can be used to improve compression ratios for specific types of data. This feature is beneficial for scenarios where the data has a predictable structure or repeating patterns.

Multi-Threading Support

Zstandard utilizes multi-threading to leverage the processing power of modern multi-core CPUs, speeding up compression and decompression tasks even further. This feature enhances performance, especially on systems with multiple CPU cores.

Usage

Usage: zstd [OPTIONS...] [INPUT... | -] [-o OUTPUT]

Options

OptionDescription
-o OUTPUTWrite output to a single file, OUTPUT.
-k, --keepPreserve INPUT file(s). [Default]
--rmRemove INPUT file(s) after successful (de)compression.
-#Desired compression level, where # is a number between 1 and 19; lower numbers provide faster compression, higher numbers yield better compression ratios. [Default: 3]
-d, --decompressPerform decompression.
-D DICTUse DICT as the dictionary for compression or decompression.
-f, --forceDisable input and output checks. Allows overwriting existing files, receiving input from the console, printing output to STDOUT, and operating on links, block devices, etc.
-c, --stdoutWrite to STDOUT (even if it is a console) and keep the INPUT file(s).
-v, --verboseEnable verbose output; pass multiple times to increase verbosity.
-q, --quietSuppress warnings; pass twice to suppress errors.
--[no-]progressForcibly show/hide the progress counter. NOTE: Any (de)compressed output to terminal will mix with progress counter text.
-rOperate recursively on directories.
--filelist LISTRead a list of files to operate on from LIST.
--output-dir-flat DIRStore processed files in DIR.
--output-dir-mirror DIRStore processed files in DIR, respecting original directory structure.
--[no-]asyncioUse asynchronous IO. [Default: Enabled]
--[no-]checkAdd XXH64 integrity checksums during compression. [Default: Add, Validate] If -d is present, ignore/validate checksums during decompression.
--ultraEnable levels beyond 19, up to 22; requires more memory.
--fast[=#]Use to very fast compression levels. [Default: 1]
--long[=#]Enable long distance matching with window log #. [Default: 27]
-T#Spawn # compression threads. [Default: 1; pass 0 for core count.]
-lPrint information about Zstandard-compressed files.
--testTest compressed file integrity.
-M#Set the memory usage limit to # megabytes.
--[no-]sparseEnable sparse mode. [Default: Enabled for files, disabled for STDOUT.]
--[no-]pass-throughPass through uncompressed files as-is. [Default: Disabled]