LinuxCommandLibrary

brotli

Compress/uncompress files with brotli compression.

TLDR

Compress a file, creating a compressed version next to the file

$ brotli [path/to/file]
copy


Decompress a file, creating an uncompressed version next to the file
$ brotli -d [path/to/file.br]
copy


Compress a file specifying the output filename
$ brotli [path/to/file] -o [path/to/compressed_output_file.br]
copy


Decompress a Brotli file specifying the output filename
$ brotli -d [path/to/compressed_file.br] -o [path/to/output_file]
copy


Specify the compression level [1=Fastest (Worst), 11=Slowest (Best)]
$ brotli -q [11] [path/to/file] -o [path/to/compressed_output_file.br]
copy

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:

brotli has 3 operation modes:

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:

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

Conflicting or duplicate options are not allowed.

OPTIONS

BUGS

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

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

Copied to clipboard