]>
Commit | Line | Data |
---|---|---|
dd4f667e LG |
1 | brotli(1) -- brotli, unbrotli - compress or decompress files |
2 | ================================================================ | |
3 | ||
4 | SYNOPSIS | |
5 | -------- | |
6 | ||
7 | `brotli` [*OPTION|FILE*]... | |
8 | ||
9 | `unbrotli` is equivalent to `brotli --decompress` | |
10 | ||
11 | DESCRIPTION | |
12 | ----------- | |
13 | `brotli` is a generic-purpose lossless compression algorithm that compresses | |
14 | data using a combination of a modern variant of the **LZ77** algorithm, Huffman | |
15 | coding and 2-nd order context modeling, with a compression ratio comparable to | |
16 | the best currently available general-purpose compression methods. It is similar | |
17 | in speed with deflate but offers more dense compression. | |
18 | ||
19 | `brotli` command line syntax similar to `gzip (1)` and `zstd (1)`. | |
20 | Unlike `gzip (1)`, source files are preserved by default. It is possible to | |
21 | remove them after processing by using the `--rm` _option_. | |
22 | ||
23 | Arguments that look like "`--name`" or "`--name=value`" are _options_. Every | |
24 | _option_ has a short form "`-x`" or "`-x value`". Multiple short form _options_ | |
25 | could be coalesced: | |
26 | ||
27 | * "`--decompress --stdout --suffix=.b`" works the same as | |
28 | * "`-d -s -S .b`" and | |
29 | * "`-dsS .b`" | |
30 | ||
31 | `brotli` has 3 operation modes: | |
32 | ||
33 | * default mode is compression; | |
34 | * `--decompress` option activates decompression mode; | |
35 | * `--test` option switches to integrity test mode; this option is equivalent to | |
36 | "`--decompress --stdout`" except that the decompressed data is discarded | |
37 | instead of being written to standard output. | |
38 | ||
39 | Every non-option argument is a _file_ entry. If no _files_ are given or _file_ | |
40 | is "`-`", `brotli` reads from standard input. All arguments after "`--`" are | |
41 | _file_ entries. | |
42 | ||
43 | Unless `--stdout` or `--output` is specified, _files_ are written to a new file | |
44 | whose name is derived from the source _file_ name: | |
45 | ||
46 | * when compressing, a suffix is appended to the source filename to | |
47 | get the target filename | |
48 | * when decompressing, a suffix is removed from the source filename to | |
49 | get the target filename | |
50 | ||
51 | Default suffix is `.br`, but it could be specified with `--suffix` option. | |
52 | ||
53 | Conflicting or duplicate _options_ are not allowed. | |
54 | ||
55 | OPTIONS | |
56 | ------- | |
57 | ||
58 | * `-#`: | |
59 | compression level (0-9); bigger values cause denser, but slower compression | |
60 | * `-c`, `--stdout`: | |
61 | write on standard output | |
62 | * `-d`, `--decompress`: | |
63 | decompress mode | |
64 | * `-f`, `--force`: | |
65 | force output file overwrite | |
66 | * `-h`, `--help`: | |
67 | display this help and exit | |
68 | * `-j`, `--rm`: | |
69 | remove source file(s); `gzip (1)`-like behaviour | |
70 | * `-k`, `--keep`: | |
71 | keep source file(s); `zstd (1)`-like behaviour | |
72 | * `-n`, `--no-copy-stat`: | |
73 | do not copy source file(s) attributes | |
74 | * `-o FILE`, `--output=FILE` | |
75 | output file; valid only if there is a single input entry | |
76 | * `-q NUM`, `--quality=NUM`: | |
77 | compression level (0-11); bigger values cause denser, but slower compression | |
78 | * `-t`, `--test`: | |
79 | test file integrity mode | |
80 | * `-v`, `--verbose`: | |
81 | increase output verbosity | |
82 | * `-w NUM`, `--lgwin=NUM`: | |
83 | set LZ77 window size (0, 10-24) (default: 22); window size is | |
84 | `(2**NUM - 16)`; 0 lets compressor decide over the optimal value; bigger | |
85 | windows size improve density; decoder might require up to window size | |
86 | memory to operate | |
87 | * `-S SUF`, `--suffix=SUF`: | |
88 | output file suffix (default: `.br`) | |
89 | * `-V`, `--version`: | |
90 | display version and exit | |
91 | * `-Z`, `--best`: | |
92 | use best compression level (default); same as "`-q 11`" | |
93 | ||
94 | SEE ALSO | |
95 | -------- | |
96 | ||
97 | `brotli` file format is defined in | |
98 | [RFC 7932](https://www.ietf.org/rfc/rfc7932.txt). | |
99 | ||
100 | `brotli` is open-sourced under the | |
101 | [MIT License](https://opensource.org/licenses/MIT). | |
102 | ||
103 | Mailing list: https://groups.google.com/forum/#!forum/brotli | |
104 | ||
105 | BUGS | |
106 | ---- | |
107 | Report bugs at: https://github.com/google/brotli/issues |