zst(1)
β¨ zst(1) β the girlies' guide to squishing files β¨
okay so bestie, welcome to zst π she's a general commands manual girlie and she is literally here to make your files smol.
πΈ NAME πΈ
zst β compress or decompress .zst/.bz2/.gz/.xz files π
π¦ SYNOPSIS π¦
zst [options] files...
that's it. that's the whole vibe. options, then files, periodt.
π DESCRIPTION π
so zst is that girl who can shrink your files using a bunch of popular compression algorithms β in this version that's zstd, bzip2, xz, and gzip β and then decompress them right back. reversible queen π
now, the native tools for each of these compressors may expose more options that are specific to whatever algorithm you're using, no shade to them. but zst unifies all of them under one common set of functionality, which is lowkey the whole point. eg, only gzip and zstd can recurse with -r, and zstd defaults to -k and its levels go up to 19 rather than 9, etc. every algorithm's got its quirks, iykyk.
the default compressor is zstd because it's the fastest while also compressing well β main character energy fr. you may want to use xz instead when disk space or network bandwidth is at a premium πΈ. on the other hand, neither gzip nor bzip2 are a superior choice in any case, but especially gzip is entrenched for historical reasons π like girl you've been around since forever and we respect it but.
π OPTIONS π
π Mode of operation
-zβ Compress, and that's the default btw. the file gets replaced by a compressed copy with an appropriate suffix added:.zst/.bz2/.xz/.gzaccording to the algorithm used π-dβ Decompress. files without a known suffix will be left untouched, so don't worry, she's not gonna touch what she doesn't recognise β-tβ Test the integrity of compressed files; this is functionally same as decompression redirected to/dev/null. it's giving "just checking, not committing" π«Ά
β¨ Modifiers
-cβ Write compressed or decompressed data to standard output. this implies-k. for compression, if the stdout is a terminal,-fmust be also specified. yes really, she's protective like that π-kβ The source file won't be removed after [de]compression. keep your originals bestie, no cap.-fβ Will overwrite existing files. also allows writing compressed data to a terminal. when-cis given and the data is not in the expected format, it will be passed through unmodified. and it allows compressing a file that's already compressed (yes, double compression, chaotic but valid π₯).-rβ If a directory is among file names specified on the command line, all files inside will be processed, possibly recursing into directories deeper in. she goes deep π-1..-9β Compression level:-1is the weakest but fastest level the algorithm knows,-9is strongest and slowest. note that unlike thezstdtool, the scale is1..9for all algorithms β level 9 corresponds to what zstd knows as 19. so don't come at her with the 19 scale, she's on her own timeline β
The defaults are: zst 2, bz2 9, gz 6, xz 6.
-vβ List all processed files. when compressing, the old, new, and percentage of required size is given. very "let me show you the receipts" π-qβ Suppress all warnings. unrelated to-v, so they don't cancel each other out or anything, they're just doing their own things π€«-nβ Ignored; for compat with gzip. she's just being polite, it does literally nothing π-Fβ Specify compression algorithm to use. pick your fighter πͺ
π RETURN VALUE π
1if any errors happened π2if there's a warning but no errors π0if all went ok β¨
π₯ SEE ALSO π₯
zstd(1), bzip2(1), gzip(1), xz(1).
and that's the whole page bestie π this was written down on 2022-10-18, and it's part of the zst(1) general commands manual β go forth and compress, you're gonna ate π«ΆπΈ
π¦ where this page comes from
- debian bookworm: zst 0.4-1 Β· GPL-2.0-or-later
- debian trixie: zst 0.4-1 Β· GPL-2.0-or-later
- ubuntu noble: zst 0.4-1 Β· GPL-2.0-or-later
- ubuntu questing: zst 0.4-1
- ubuntu resolute: zst 0.4-1.1 Β· GPL-2.0-or-later
- ubuntu stonking: zst 0.4-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms