Purpose
Compresses
files.
Syntax
pack [ -f ] [ - ] File ...
Description
The
pack command
stores the file specified by the
File parameter in a compressed
form. The input file is replaced by a packed file with the same name
and the suffix
.z appended. If the invoking process has appropriate
privileges, the packed file maintains the same access modes, access
and modification dates, and owner as the original file. The input
file name can contain no more than 253 bytes to allow space for the
added
.z suffix. If the
pack command is successful,
the original file is removed. Packed files can be restored to their
original form using the
compress command.
The exit value of the pack command
is the number of files that it could not pack. The pack command
does not pack under any of the following conditions:
- The file is already packed.
- The input file name has
more than 253 bytes.
- The file has links.
- The file is a directory.
- The file cannot be opened.
- No storage blocks are
saved by packing.
- A file called File.z already
exists.
- The .z file cannot
be created.
- An I/O error occurred
during processing.
Flags
Item |
Description |
-f |
Forces packing of the file specified by the File parameter.
This is useful for packing an entire directory, even if some of the
files will not benefit. |
Parameters
Item |
Description |
File |
Specifies the file to be packed. |
- |
Displays statistics about the file specified by the File parameter.
The statistics are calculated from a Huffman minimum redundancy code
tree built on a byte-by-byte basis. Additional occurrences of the - (minus
sign) parameter on the command line toggles this function for the
next specified file. See example 2. |
Exit Status
This command
returns the following exit values:
Item |
Description |
0 |
Specifies that the file was successfully packed. |
>0 |
Specifies that an error occurred. |
Examples
- To compress the files
named chap1 and chap2 and display the revised file
names, enter:
pack chap1 chap2
The
compressed versions are renamed
chap1.z and
chap2.z.
The
pack command displays the percent decrease in size for
each file compressed.
- To display statistics
about the amount of compression done, enter:
pack - chap1 - chap2
This
compresses the files named chap1 and chap2 and displays
statistics about the file named chap1, but not about the
file named chap2. The first - (minus sign) parameter
turns on the statistic display, and the second - parameter
turns it off.
Files
Item |
Description |
/usr/bin/pack |
Contains the pack command. |