Home | History | Annotate | Download | only in docs
"BROTLI" "1" "February 2018" "brotli 1.0.0" "User commands"
"NAME"
brotli - brotli, unbrotli - compress or decompress files
SYNOPSIS

brotli [OPTION|FILE]\.\.\.

unbrotli is equivalent to brotli --decompress

DESCRIPTION

brotli is a generic-purpose lossless compression algorithm that compresses data using a combination of a modern variant of the LZ77 algorithm, Huffman coding and 2-nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods\. It is similar in speed with deflate but offers more dense compression\.

brotli command line syntax similar to gzip (1) and zstd (1)\|\. Unlike gzip (1), source files are preserved by default\. It is possible to remove them after processing by using the --rm option\|\.

Arguments that look like "--name" or "--name=value" are options\|\. Every option has a short form "-x" or "-x value"\. Multiple short form options could be coalesced:

\(bu 2
"--decompress --stdout --suffix=\.b" works the same as
\(bu 2
"-d -s -S \.b" and
\(bu 2
"-dsS \.b"

brotli has 3 operation modes:

\(bu 2
default mode is compression;
\(bu 2
--decompress option activates decompression mode;
\(bu 2
--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\.

Every non-option argument is a file entry\. If no files are given or 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:

\(bu 2
when compressing, a suffix is appended to the source filename to get the target filename
\(bu 2
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 --suffix option\.

Conflicting or duplicate options are not allowed\.

OPTIONS
\(bu 2
-#: compression level (0-9); bigger values cause denser, but slower compression
\(bu 2
-c, --stdout: write on standard output
\(bu 2
-d, --decompress: decompress mode
\(bu 2
-f, --force: force output file overwrite
\(bu 2
-h, --help: display this help and exit
\(bu 2
-j, --rm: remove source file(s); gzip (1)-like behaviour
\(bu 2
-k, --keep: keep source file(s); zstd (1)-like behaviour
\(bu 2
-n, --no-copy-stat: do not copy source file(s) attributes
\(bu 2
-o FILE, --output=FILE output file; valid only if there is a single input entry
\(bu 2
-q NUM, --quality=NUM: compression level (0-11); bigger values cause denser, but slower compression
\(bu 2
-t, --test: test file integrity mode
\(bu 2
-v, --verbose: increase output verbosity
\(bu 2
-w NUM, --lgwin=NUM: set LZ77 window size (0, 10-24) (default: 22); window size is (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
\(bu 2
-S SUF, --suffix=SUF: output file suffix (default: \|\.br)
\(bu 2
-V, --version: display version and exit
\(bu 2
-Z, --best: use best compression level (default); same as "-q 11"
SEE ALSO

brotli file format is defined in RFC 7932 https://www\.ietf\.org/rfc/rfc7932\.txt\|\.

brotli is open-sourced under the MIT License https://opensource\.org/licenses/MIT\|\.

Mailing list: https://groups\.google\.com/forum/#!forum/brotli

BUGS

Report bugs at: https://github\.com/google/brotli/issues