MPE/iX Shell and Utilities Reference Manual, Vol 1

compress(1) MPE/iX Shell and Utilities compress(1)
NAME
compress — Lempel-Ziv compression of a file
SYNOPSIS
compress [–cDdfVv][–b bits][file ...]
DESCRIPTION
compress compresses each input file using Lempel-Ziv compression techniques. If you do
not specify any input files, compress reads data from the standard input and writes the com-
pressed result to the standard output.
On
UNIX and POSIX-compliant systems, the output files have the same names as the input files
but with a .Z suffix. For example, abc is compressed into abc.Z. If the .Z file already
exists and you did not specify the –f option, compress gives an error and asks you whether
or not it should overwrite the existing file.
compress uses the modified Lempel-Ziv algorithm (described in A Technique for High Per-
formance Data Compression, Terry A. Welch, IEEE Computer, vol. 17, no. 6 (June 1984), pp.
8-19). compress first replaces common substrings in the file by 9-bit codes starting at 257.
After it reaches code 512, compress begins with 10-bit codes, and continues to use more
bits until it reaches the limit set by the –b option.
After attaining the bits limit, compress periodically checks the compression ratio. If it is
increasing, compress continues to use the existing code dictionary. However, if the com-
pression ratio decreases, compress discards the table of substrings and rebuilds it from
scratch. This allows the algorithm to compensate for files, such as archives, where individual
components have different information content profiles.
Options
compress accepts the following options:
–b bits limits the maximum number of bits of compression to bits. The value bits may be an
integer from 9 to 16. The default is 16.
–c writes the output to the standard output. When you use this option, you can only
specify one file on the command line.
–D performs an extra degree of compression on files such as sorted dictionaries where
consecutive lines normally have many characters in common.
–d decompresses argument files instead of compressing them. This works by overlaying
the compress program with the uncompress program. For this to work,
uncompress must be available somewhere in your search path (given by the
PATH
environment variable). Decompressing files this way is slower than calling
uncompress directly.
Commands and Utilities 1-123