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