2025-03-14 21:59:59 -06:00
|
|
|
# zstd
|
|
|
|
|
|
|
|
|
|
> Compress or decompress files with Zstandard compression.
|
2026-02-18 06:55:01 -07:00
|
|
|
> More information: <https://manned.org/zstd>.
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Compress a file into a new file with the `.zst` suffix:
|
|
|
|
|
|
|
|
|
|
`zstd {{path/to/file}}`
|
|
|
|
|
|
|
|
|
|
- Decompress a file:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`zstd {{[-d|--decompress]}} {{path/to/file.zst}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Decompress to `stdout`:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`zstd {{[-d|--decompress]}} {{[-c|--stdout]}} {{path/to/file.zst}}`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Compress a file specifying the compression level, where 1=fastest, 19=slowest, and 3=default:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
`zstd -{{level}} {{path/to/file}}`
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
- Compress a file using an ultra-fast compression level, where 1=default:
|
|
|
|
|
|
|
|
|
|
`zstd --fast={{level}} {{path/to/file}}`
|
|
|
|
|
|
2025-03-14 21:59:59 -06:00
|
|
|
- Unlock higher compression levels (up to 22) using more memory (both for compression and decompression):
|
|
|
|
|
|
|
|
|
|
`zstd --ultra -{{level}} {{path/to/file}}`
|
2026-02-18 06:55:01 -07:00
|
|
|
|
|
|
|
|
- Set the number of working threads to the number of physical CPU cores:
|
|
|
|
|
|
|
|
|
|
`zstd {{[-T|--threads]}} 0`
|