Open System Services Shell and Utilities Reference Manual (G06.28+, H06.05+)
User Commands (p - r) pax(1)
If intermediate directories are necessary to extract an archive member, pax creates the directories
with access permissions set as the bitwise inclusive OR of the values of S_IRWXU, S_IRWXG,
and S_IRWXO.
Read Mode
When the -r flag is specified but the -w flag is not, pax extracts the members of an archive file
read from the standard input file, and with pathnames matching the pattern operand if one is
specified. If an extracted file is a directory, the file hierarchy contained in the directory is also
extracted. The extracted files are created relative to the current file hierarchy. The -r flag can be
specified with the -c, -d, -f, -n, -s, and -v flags and a pattern operand.
The access and modification times of the extracted files are the same as the archived files. The
access permissions of the extracted files remain as archived unless affected by the user’s default
file creation mode. The S_ISUID and S_ISGID bits of the extracted files 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 specification of linked files, it is an error if these files
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 files.
The ownership, access and modification times, and file mode of the restored files are discussed in
the description of the -p flag.
Write Mode
When the -w flag is specified and the -r flag is not, pax writes the contents of the files specified
by the file operands to the standard output file in an archive format. If no file operands are
specified, a list of files to copy, one per line, is read from the standard input file. When the file
operand specifies a directory, all of the files contained in the directory are written. The -w flag
can be specified with the -b, -d, -f, -i, -s, -t, -u, -v, -x, and -X flags and with file operands.
If -w is specified but no files are specified, the standard input file is used. If neither -f nor -w is
specified, the standard input file must be an archive file.
Copy Mode
When both the -r and -w flags are specified, pax copies the files specified by the file operand to
the destination directory specified by the directory operand. If no file arguments are specified, a
list of files to copy, one per line, is read from the standard input file. If a specified file is a direc-
tory, the file hierarchy contained in the directory is also copied. The -r and -w flags can be
specified with the -d, -i, -k, -l, -p, -n, -s, -t, -u, -v, and -X flags and with the file operands. A
directory operand must be specified.
Copied files are the same as if they were written to an archive file and subsequently extracted,
except that there might be hard links between the original and the copied files.
For filesets that support OSS access control lists (ACLs), this command also copies any ACL |
entries associated with the file, so that the copied file has the same ACL entries as the source file. |
If the parent directory has an ACL that contains default ACL entries, the new directory inherits |
ACL entries and permissions as described in the acl(5) reference page.
Standard Input
The input file is named by the archive argument of the -f flag.. If the archive argument maps to a
disk file, the input file must must be formatted in either cpio or ustar data interchange format. If
the archive is read from a Guardian tape device, the tape file mounted on that device must be for-
matted in either cpio or ustar data interchange format.
The file /dev/tty is used to write tape mount messages.
527188-007 Hewlett-Packard Company 7−17