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

User Commands (p - r) pax(1)
Read Mode
When the -r ag is specied but the -w ag is not, pax extracts the members of an archive le
read from the standard input le, and with pathnames matching the pattern operand if one is
specied. If an extracted le is a directory, the le hierarchy contained in the directory is also
extracted. The extracted les are created relative to the current le hierarchy. The -r ag can be
specied with the -c, -d, -f, -n, -s, and -v ags and a pattern operand.
The access and modication times of the extracted les are the same as the archived les. The
access permissions of the extracted les remain as archived unless affected by the users default
le creation mode. The S_ISUID and S_ISGID bits of the extracted les are cleared.
If intermediate directories are necessary to extract an archive member, the pax command creates
the directories with access permissions set as the bitwise inclusive OR of the values of
S_IRWXU, S_IRWXG, and S_IRWXO.
If the selected archive format supports the specication of linked les, it is an error if these les
cannot be linked when the archive is extracted. pax informs you of the error and continues pro-
cessing. Both the ustar and cpio formats support hard-linked les.
The ownership, access and modication times, and le mode of the restored les are discussed in
the description of the -p ag.
Write Mode
When the -w ag is specied and the -r ag is not, pax writes the contents of the les specied
by the le operands to the standard output le in an archive format. If no le operands are
specied, a list of les to copy, one per line, is read from the standard input le. When the le
operand species a directory, all of the les contained in the directory are written. The -w ag
can be specied with the -b, -d, -f, -i, -s, -t, -u, -v, -x, and -X ags and with le operands.
If -w is specied but no les are specied, the standard input le is used. If neither -f nor -w is
specied, the standard input le must be an archive le.
Copy Mode
When both the -r and -w ags are specied, pax copies the les specied by the le operand to
the destination directory specied by the directory operand. If no le arguments are specied, a
list of les to copy, one per line, is read from the standard input le. If a specied le is a direc-
tory, the le hierarchy contained in the directory is also copied. The -r and -w ags can be
specied with the -d, -i, -k, -l, -p, -n, -s, -t, -u, -v, and -X ags and with the le operands. A
directory operand must be specied.
Copied les are the same as if they were written to an archive le and subsequently extracted,
except that there might be hard links between the original and the copied les.
Standard Input
The input le is named by the archive argument of the -f ag.. If the archive argument maps to a
disk le, the input le must must be formatted in either cpio or ustar data interchange format. If
the archive is read from a Guardian tape device, the tape le mounted on that device must be for-
matted in either cpio or ustar data interchange format.
The le /dev/tty is used to write tape mount messages.
In write mode, the standard input le is used only if no le operand is specied. The standard
input le must be a text le containing a list of pathnames, one per line, without leading or trail-
ing blank characters. In list and read modes, the standard input le must be an archive le. In all
other cases, the standard input le is not used.
527188-003 Hewlett-Packard Company 717