rzopfli(1)

NAME

rzopfli - a lossless data compression tool using Zopfli

SYNOPSIS

rzopfli [OPTION]…​ [FILE]…​

DESCRIPTION

rzopfli is a lossless data compression tool which uses the Zopfli compression algorithm. rzopfli command line syntax is similar to gzip(1) and zstd(1), and some options derived from the Zopfli reference implementation. Zopfli achieves higher compression ratios than other DEFLATE compressors, generating standard DEFLATE streams that can be decompressed with any DEFLATE decompressor, at the cost of being slower.

rzopfli preserves input files by default, just like zstd(1). It’s possible to remove them automatically by using --rm.

If FILE is not specified, or if "-" is specified, rzopfli reads data from standard input and writes the processed data to standard output. rzopfli will refuse to write processed data to standard output if it is a terminal and --force is not specified. Similarly, rzopfli will refuse to read data from standard input if it is a terminal and --stdout or --force is not specified.

If FILE is a file, the processed data is written to a new file whose name is the input filename with the appropriate extension (either .gz, .zlib, or .deflate) appended, unless --stdout is specified.

POSITIONAL ARGUMENTS

FILE

Files to compress. If FILE is not specified, or if "-" is specified, data will be read from standard input.

OPTIONS

-c, --stdout

Write to standard output, keep original files. This option conflicts with --rm and --suffix.

-f, --force

Force compression even if the output file already exists. This option allows you to overwrite existing files.

-k, --keep

Keep input files. This is the default behavior. This option conflicts with --rm.

--rm

Remove input files after successful compression. This option conflicts with --stdout and --keep.

-S, --suffix SUFFIX

Use SUFFIX as the suffix for the target file instead of .gz, .zlib, or .deflate. Any non-empty UTF-8 string which starts with . and does not contains a path separator can be specified as the suffix. This option conflicts with --stdout.

-i, --iteration TIMES

Perform compression for the specified number of iterations. Higher numbers produce higher compression ratio at the expense of compression speed. Default is 15.

--format FORMAT

Output to the specified format.

The possible values are:
gzip

The gzip file format, as defined in RFC 1952. This value will append the extension .gz to the input filename. This is the default value.

zlib

The zlib file format, as defined in RFC 1950. This value will append the extension .zlib to the input filename.

deflate

The raw DEFLATE stream format, as defined in RFC 1951. This value will append the extension .deflate to the input filename.

--log-level LEVEL

The minimum log level to print.

The possible values are:
OFF

Lowest log level.

ERROR

Error log level.

WARN

Warn log level.

INFO

Info log level. This is the default value.

DEBUG

Debug log level.

TRACE

Trace log level.

-h, --help

Print help message. The short flag (-h) will print a condensed help message while the long flag (--help) will print a detailed help message.

-V, --version

Print version number. The long flag (--version) will also print the copyright notice, the license notice and where to report bugs.

--generate-completion SHELL

Generate shell completion. The completion is output to standard output.

The possible values are:
bash

Bash.

elvish

Elvish.

fish

fish.

nushell

Nushell.

powershell

PowerShell.

zsh

Zsh.

EXIT STATUS

0

Successful program execution.

1

An error occurred.

2

An error occurred while parsing command-line arguments.

65

The input data was incorrect in some way.

66

An input file (not a system file) did not exist or was not readable.

69

A service is unavailable.

70

An internal software error has been detected.

71

An operating system error has been detected.

73

A (user specified) output file cannot be created.

74

An error occurred while doing I/O on some file.

75

Temporary failure, indicating something that is not really an error.

77

You did not have sufficient permission to perform the operation.

EXAMPLES

Compress a file into the gzip format:

$ rzopfli foo.txt

Write the processed data to standard output:

$ rzopfli -c foo.txt

Remove an input file after successful compression:

$ rzopfli --rm foo.txt

Performs 50 compression iterations:

$ rzopfli -i 50 foo.txt

Compress a file into the zlib format:

$ rzopfli --format zlib foo.txt

Copyright © 2024 Shun Sakai

  1. This program is distributed under the terms of either the Apache License 2.0 or the MIT License.

  2. This manual page is distributed under the terms of the Creative Commons Attribution 4.0 International Public License.

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

SEE ALSO

gzip(1), zstd(1)