HP-UX Reference (11i v3 07/02) - 1 User Commands N-Z (vol 2)
p
pax(1) pax(1)
Unlike the ustar header block fields, NULs shall not delimit values; all characters within the value field
shall be considered data for the field. None of the length limitations of the
ustar header block fields in
ustar Header Block shall apply to the extended header records.
pax Extended Header Keyword Precedence
This section describes the precedence in which the various header records and fields and command line
options are selected to apply to a file in the archive. When
pax is used in read or list modes, it shall
determine a file attribute in the following sequence:
1. If
-o delete= keyword-prefix is used, the affected attributes shall be determined from Step 7., if
applicable, or ignored otherwise.
2. If -o keyword:= is used, the affected attributes shall be ignored.
3. If
-o keyword:=value is used, the affected attribute shall be assigned the value.
4. If there is a
typeflag x extended header record, the affected attribute shall be assigned the value.
When extended header records conflict, the last one given in the header shall take precedence.
5. If
-o keyword=
value is used, the affected attribute shall be assigned the value.
6. If there is a
typeflag g global extended header record, the affected attribute shall be assigned the
value. When global extended header records conflict, the last one given in the global header shall
take precedence.
7. Otherwise, the attribute shall be determined from the
ustar header block.
pax Extended Header File Times
The
pax utility shall write an mtime record for each file in write or copy
modes if the file’s
modification time cannot be represented exactly in the
ustar header logical record described in ustar
Interchange Format. This can occur if the time is out of
ustar range, or if the file system of the underly-
ing implementation supports non-integer time granularities and the time is not an integer. All of these time
records shall be formatted as a decimal representation of the time in seconds since the Epoch. If a period (
’.’ ) decimal point character is present, the digits to the right of the point shall represent the units of a sub
second timing granularity, where the first digit is tenths of a second and each subsequent digit is a tenth of
the previous digit.
RETURN VALUE
The
pax command returns a value of 0 (zero) if all files were successfully processed; otherwise,
pax
returns a value greater than 0 (zero).
EXAMPLES
To copy the contents of the current directory to the tape drive, enter:
pax -w -f /dev/rtape/tape4QIC150 .
To copy the olddir directory hierarchy to newdir enter:
mkdir newdir
pax -rw olddir newdir
To read the archive a.pax, with all files rooted in the directory /usr in the archive extracted relative to
the current directory, enter:
pax -r -s ’,//*usr//*,,’ -f a.pax
All of the preceding examples create archives in tar format.
The following pairs of commands demonstrate conversions from cpio and tar to pax. In all cases, the
examples show comparable command-line usage rather than identical output formats. The -x flag can be
specified to the pax commands shown here, producing archives to select specific output formats:
ls * | cpio -ocv
pax -wdv *
find /mydir -type f -print | cpio -oc
find /mydir -type f -print | pax -w
cpio -icdum < archive
pax -r < archive
116 Hewlett-Packard Company − 12 − HP-UX 11i Version 3: February 2007