zstdmt(1)
Multi-threaded Zstandard compression utility for parallel compression and decompression of files.
Synopsis
zstdmt [OPTION]... [FILE]...Description
zstdmt is a multi-threaded variant of the Zstandard (zstd) compression tool that leverages multiple CPU cores for faster compression and decompression. It maintains compatibility with the standard zstd format while providing improved performance on multi-core systems by automatically parallelizing compression work across available threads.
The tool processes files by splitting them into independent blocks that can be compressed or decompressed in parallel, making it ideal for batch processing, large file compression, and systems with multiple processor cores.
Common options
| Flag | What it does |
|---|---|
-# | Compression level (1-22, default 3); higher = better compression but slower |
-d, --decompress | Decompress files instead of compressing |
-o FILE | Write output to specified file instead of stdout or default name |
-f, --force | Overwrite output files without prompting |
-k, --keep | Keep (don't delete) input files after compression/decompression |
-T#, --threads=# | Use # parallel threads (0 = auto-detect based on CPU cores) |
-c, --stdout | Write to stdout, leaving input files unchanged |
-v, --verbose | Verbose output; show compression statistics and progress |
-q, --quiet | Suppress informational messages and warnings |
--ultra | Enable ultra compression levels (20-22) for maximum compression |
-t, --test | Test file integrity without decompressing to disk |
-r | Recursively compress/decompress all files in directories |
Examples
Compress largefile.bin with high compression level (19) using multiple threads, outputs largefile.bin.zst
zstdmt -19 largefile.binDecompress archive.zst and write output to recovered.bin using parallel decompression
zstdmt -d archive.zst -o recovered.binCompress all .log files with 8 threads at level 3 compression into combined.zst
zstdmt -T8 -3 *.log -o combined.zstCompress to stdout and pipe over SSH for remote backup with parallel compression
zstdmt -c -19 source.tar | ssh user@host 'cat > backup.tar.zst'Recursively compress all files in /var/log with auto-threaded performance, keeping originals
zstdmt -r -k -T0 /var/logDecompress multiple .zst files with verbose output showing statistics for each
zstdmt -d -v *.zstMaximum compression (level 22) using 4 threads for critical database backup
zstdmt -T4 --ultra -22 critical-backup.sqlTest integrity of compressed archive without decompressing to disk
zstdmt -t largearchive.zst && echo 'Archive is valid'