The compress(1) utility uses adaptive Lempel-Ziv coding to
reduce the size of files. (The utilities gzip(1),
pack(1) and zip(1) also compress data, but they use
different algorithms.) The compress(1) utility reads data
from the specified files or from standard input if no
files are specified or if one of the files is
-. If compress(1) reads standard input, it writes to
standard output. If compress(1) is not writing to standard
output, it replaces the file with a new file whose name has the
extension .Z appended. If adding .Z makes the name longer than
{NAME_MAX} bytes long, the operation fails.
If no files are specified, or the -c option is given, the
compressed data is written to standard output.
If the invoking process has the appropriate privileges,
compress(1) preserves the ownership, modes, access time, and
modification time of the original file.
The XPG 4 specification recommends that, for portability reasons,
bits not be set to a value larger than 14. Most
implementations support values up to 16, but this is not guaranteed
or required by any standards.