packcompress files by Huffman encoding |
Command |
pack
[[-]
[-f]
[-o file]
file] ...
pack compresses argument files using a Huffman
minimal redundancy code on a byte basis. By default, compressed files have a
.z extension appended to the file name, but keep the same owner,
permissions, last access time, and last modification time. For example,
abc is compressed into abc.z. pack
appends the .z to the end of files even if they already have
suffixes. For example abc.txt is compressed into
abc.txt.z.
Packed files can be identified by file
and uncompressed by unpack (which
unpacks the file in place) or pcat
(which unpacks to the standard output).
Normally pack reports the degree of compression achieved in
each file (the report is printed on the standard output). This number can be
negative for small files with little redundancy if the -f
option is used.
pack refuses to pack a file for the following reasons:
.z
is appended)-displays more detail on size, overhead and entropy (information rate). If this option is used several times on the command line it acts as a toggle, inverting the detailed-report flag at each mention.
-fforces compression when it normally would not occur. Without this
option, pack does not compress a file if its size is
not reduced by compression, the file is already compressed, or the file
has more than one link.
-o filespecifies a different output file so that compressed output is written to file rather than overwriting the original input file. Several input and output files may be specified. For example,
pack -o out1 in1 -o out2 in2
packs file in1 into out1 and file
in2 into out2. The input files are not
changed.
0Successful completion.
1An error occurred related to manipulating (opening, closing, renaming)
the file, or a single file could not be packed properly (see
n).
nIndicates that n files could not be packed properly. For
example, if three out of six files could not be packed properly, the exit
status is 3. Possible reasons for failure include:
pack could not set the modified time of a packed
fileThe file is too small or uniform to benefit from packing. The
file can be packed anyway using the -f option.
The file appears to be a packed file. It can be packed
nonetheless by specifying the -f option.
The file has more than one link. Override with the
-f option.
pack refuses to modify directories.
The file is empty.
The file is too large to pack in place. You must specify an
output file using the -o option.
If you press BREAK while pack is in operation, it
does not stop immediately; if it did, it would leave you with a corrupted
file. Thus pack just displays this message to show
that the BREAK has been received and it stops as soon as it is safe to do
so.
-o option is an extension to x/OPEN.