pack.1 (2010 09)

p
pack(1) pack(1)
NAME
pack, pcat, unpack - compress and expand files using Huffman code
SYNOPSIS
pack [-][-f] name...
pcat name...
unpack name...
DESCRIPTION
pack attempts to store the specified files in a compressed form. Wherever possible, each input file name
is replaced by a packed file name
.z with the same ownership, modes, and access and modification times.
The
-f option forces packing of name. This is useful for causing an entire directory to be packed even if
some of the files do not benefit. If
pack is successful, name is removed. Packed files can be restored to
their original form using
unpack or pcat.
pack uses Huffman (minimum redundancy) codes on a byte-by-byte basis. If the
- argument is used, an
internal flag is set that causes the number of times each byte is used, its relative frequency, and the code
for the byte to be printed on the standard output. Additional occurrences of
- in place of name cause the
internal flag to be set and reset.
The amount of compression obtained depends on the size of the input file and the character frequency dis-
tribution. Because a decoding tree forms the first part of each
.z file, it is usually not worthwhile to
pack files smaller than three blocks unless the character frequency distribution is very skewed such as in
printer plots or pictures.
Typically, text files are reduced to 60-75% of their original size. Load modules, which use a larger charac-
ter set and have a more uniform distribution of characters, show little compression, the packed versions
being about 90% of the original size.
pack returns a value that is the number of files that it failed to compress.
No packing occurs if:
The file appears to be already packed.
The file name has more than 12 characters and the file system is configured as a short filename sys-
tem.
The file has links.
The file is a directory.
The file cannot be opened.
The file is empty.
No disk storage blocks will be saved by packing.
A file called name
.z already exists.
The
.z file cannot be created.
An I/O error occurred during processing.
On short file name systems, the last segment of the file name must contain no more than 12 characters to
allow space for the appended
.z extension. Directories cannot be compressed.
pcat does for packed files what cat does for ordinary files, except that pcat cannot be used as a filter.
The specified files are unpacked and written to the standard output. Thus to view a packed file named
name.z use:
pcat name.z
or simply:
pcat name
To make an unpacked copy (named file) of a packed file named name.z without destroying name.z) use
the command:
pcat name >file
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (2 pages)