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/.gz according 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, -f must 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 -c is 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: -1 is the weakest but fastest level the algorithm knows, -9 is strongest and slowest. note that unlike the zstd tool, the scale is 1..9 for 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 🌈

  • 1 if any errors happened 😭
  • 2 if there's a warning but no errors πŸ™ˆ
  • 0 if 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