brotli(1)

πŸ“¦
version 1.2.1 Β· 3 versions
, in alpine 3.23, alpine 3.24, arch rolling, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– brotli(1) β€” the User Manual, bestie edition πŸ’–

okay so hi. this is the manual for brotli(1), and yes there's also brcat and unbrotli in the mix β€” they're the same tool wearing different outfits. buckle up, we're gonna make your files smol. πŸŽ€


✨ NAME ✨

brotli(1) β€” aka brotli, brcat, unbrotli β€” compress or decompress files. that's the whole job. iconic honestly. πŸ’…


🌸 SYNOPSIS 🌸

brotli [OPTION|FILE]...
  • brcat is literally just brotli --decompress --concatenated --stdout
  • unbrotli is literally just brotli --decompress

same girl, different vibes. πŸ¦‹


🫢 DESCRIPTION 🫢

so brotli is a generic-purpose lossless compression algorithm β€” lossless meaning nothing gets thrown away, your data comes back exactly how it left. it squishes your data using a combo of a modern variant of the LZ77 algorithm, Huffman coding, and 2nd order context modeling. the compression ratio? comparable to the best currently available general-purpose compression methods. no cap. it's similar in speed with deflate but offers more dense compression. so like, same-ish speed, tinier output. we love a glow-up. ✨

the brotli command line syntax is similar to gzip(1) and zstd(1). but here's the plot twist β€” unlike gzip(1), source files are preserved by default. your originals stay safe, periodt. and if you do want them gone after processing, you can remove them with the --rm option. your call, bestie. πŸ’œ

arguments that look like --name or --name=value are options. every option has a short form -x or -x value. and multiple short form options could be coalesced, which is so satisfying:

  • --decompress --stdout --suffix=.b works the same as
  • -d -s -S .b and
  • -dsS .b

look at that last one. compressed and cunty. 😌

brotli has 3 operation modes:

  • default mode is compression (the main character)
  • --decompress option activates decompression mode
  • --test option switches to integrity test mode; this option is equivalent to --decompress --stdout except that the decompressed data is discarded instead of being written to standard output. so it checks the vibe and then ghosts the output. πŸ’€

every non-option argument is a file entry. if no files are given, or if the file is -, brotli reads from standard input. all arguments after -- are file entries.

unless --stdout or --output is specified, files are written to a new file whose name is derived from the source file name:

  • when compressing, a suffix is appended to the source filename to get the target filename
  • when decompressing, a suffix is removed from the source filename to get the target filename

default suffix is .br, but it could be specified with the --suffix option.

⚠️ conflicting or duplicate options are not allowed. don't try it. the tool said no. πŸ™ˆ

πŸ‘‘ OPTIONS πŸ‘‘

  • -# β€” compression level (0-9); bigger values cause denser, but slower compression. denser = more slay, but she takes her time. 🐌✨
  • -c, --stdout β€” write on standard output. no new files, just vibes to your terminal. πŸ–₯️
  • -d, --decompress β€” decompress mode. un-squish time. πŸ¦‹
  • -f, --force β€” force output file overwrite. she will not ask twice. πŸ’…
  • -h, --help β€” display this help and exit. the girlie will explain herself. πŸ“–
  • -j, --rm β€” remove source file(s); that's the gzip(1)-like behaviour. bye bye original. 😭
  • -k, --keep β€” keep source file(s); that's the zstd(1)-like behaviour. original stays, we protect her. 🫢
  • -n, --no-copy-stat β€” do not copy source file(s) attributes. fresh file, no inherited lore. ✨
  • -o FILE, --output=FILE β€” output file; valid only if there is a single input entry. one input, one output. don't be greedy. πŸ™…
  • -q NUM, --quality=NUM β€” compression level (0-11); bigger values cause denser, but slower compression. yes this goes higher than -#. she contains multitudes. πŸ”₯
  • -t, --test β€” test file integrity mode. just checking, not committing. πŸ‘€
  • -v, --verbose β€” increase output verbosity. she starts telling you everything. πŸ—£οΈ
  • -w NUM, --lgwin=NUM β€” set LZ77 window size (0, 10-24) (default: 24); window size is (pow(2, NUM) - 16); 0 lets compressor decide over the optimal value; bigger windows size improve density; decoder might require up to window size memory to operate. bigger window = denser output but the decoder's gotta have the RAM for it. plan accordingly bestie. 🧠
  • -C B64, --comment=B64 β€” set comment; argument is base64-decoded first; when decoding: check stream comment; when encoding: embed comment (fingerprint). a lil signature, a lil mark of ownership. πŸ’Œ
  • -D FILE, --dictionary=FILE β€” use FILE as raw (LZ77) dictionary; same dictionary MUST be used both for compression and decompression. like, this is not a suggestion. both sides or it breaks. ⚠️
  • -K, --concatenated β€” when decoding, allow concatenated brotli streams as input. multiple streams walking in together, holding hands. 🌈
  • -S SUF, --suffix=SUF β€” output file suffix (default: .br). pick your own lil ending. πŸŽ€
  • -V, --version β€” display version and exit. she'll tell you what era she's in. ⭐
  • -Z, --best β€” use best compression level (default); same as -q 11. maximum effort, maximum density, maximum icon behaviour. πŸ‘‘

🌈 SEE ALSO 🌈

the brotli file format is defined in RFC 7932 (https://www.ietf.org/rfc/rfc7932.txt). the receipts, the lore, the whole spec.

brotli is open-sourced under the MIT License (https://opensource.org/licenses/MIT). free to use, free to love. 🫢

Mailing list: https://groups.google.com/forum/#!forum/brotli β€” come hang out, iykyk. πŸ’œ


πŸ’€ BUGS πŸ’€

found something cursed? report bugs at: https://github.com/google/brotli/issues


and that's the whole page bestie, you're officially brotli-pilled. this was brotli version 1.0.9, dated August 14 2021, and honestly? she's been slaying since day one. go compress something. πŸ’–βœ¨πŸŽ€