Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

User Commands (c) compress(1)
NAME
compress - Compresses or decompresses data
SYNOPSIS
compress [-CdfFnqvV][-b maxbits][le ...]
compress [-cCdfFnqvV][-b maxbits][le]
FLAGS
-b maxbits
Species the maximum number of bits to use to replace common substrings in the le.
The default value for the maxbits argument is 16, with values of 9 through 16 accept-
able. First, the algorithm uses 9-bit codes 257 through 512. Then it uses 10-bit codes,
continuing until the maxbits limit is reached. (This action is not permitted with the
uncompress command.)
After the maxbits limit is reached, the compress command periodically checks the
compression ratio. If the ratio increases, compress continues to use the existing code
dictionary. However, if the compression ratio decreases, compress discards the table
of substrings and rebuilds it from the beginning. This strategy allows the algorithm to
adapt to the next block of the le.
-c Makes the compress command write to the standard output le; no input les are
changed and no .Z le is created. The nondestructive behavior of the zcat command is
identical to that of compress -cd.
-C Produces output compatible with BSD compress revision 2.0.
-d Species decompression (uncompressing) the specied le.
-f or -F For both compressing and decompressing les (except when this command is run in the
background under the /usr/bin/sh le), this ag suppresses the prompt as to whether an
existing le given by the le operand should be overwritten. For compressing les
only, this ag forces the compression of le even if the le does not actually get
smaller or the corresponding le.Z already exists.
-n Species that no header is added or expected. This ag might be useful for
decompressing old les.
-q Species a quiet operation. This ag is the default action; diagnostics are displayed
only if the -v ag is specied.
-v For a compression operation, prints the percentage reduction of each le. For a
decompression operation, this ag prints the percentage expansion of each le.
-V Displays the version number and any options with which the program was compiled.
DESCRIPTION
The compress command reduces the size of the specied les using adaptive Lempel-Ziv cod-
ing.
For compress, whenever possible, each le is replaced by one with the extension .Z that has the
same ownership modes, access, and modication times. Note that the lename extension used by
compress is different from that used by pack command compression (.z extension). If no les
are specied or if the le operand is a - (dash), the standard input le is compressed and written
to the standard output le. If appending the .Z extension to the lename would make the name
exceed NAME_MAX bytes, the compress command fails.
Compressed les can be restored to their original form using the uncompress or zcat command
or using the compress command with the -d ag.
527188-003 Hewlett-Packard Company 265