673 lines
13 KiB
Plaintext
673 lines
13 KiB
Plaintext
.\" @(#)pax.1v 1.1 94/10/31 SMI; new for 4.1
|
|
.TH PAX 1V "6 September 1989"
|
|
.SH NAME
|
|
pax \- portable archive exchange
|
|
.SH SYNOPSIS
|
|
.B /usr/5bin/pax
|
|
[
|
|
.B \-cimopuvy
|
|
]
|
|
.RI
|
|
[
|
|
.BI \-f " archive"
|
|
[
|
|
.BI \-s " replstr"
|
|
]
|
|
[
|
|
.BI \-t " device"
|
|
]
|
|
[
|
|
.IR pattern \|.\|.\|.
|
|
]
|
|
.br
|
|
.B /usr/5bin/pax
|
|
.B \-r
|
|
[
|
|
.B \-cimnopuvy
|
|
]
|
|
[
|
|
.BI \-f " archive"
|
|
]
|
|
[
|
|
.BI \-s " replstr"
|
|
]
|
|
[
|
|
.BI \-t " device"
|
|
]
|
|
[
|
|
.IR pattern \|.\|.\|.
|
|
]
|
|
.br
|
|
.B /usr/5bin/pax
|
|
.B \-w
|
|
[
|
|
.B \-adimuvy
|
|
]
|
|
[
|
|
.BI \-b " blocking"
|
|
]
|
|
[
|
|
.BI \-f " archive"
|
|
]
|
|
[
|
|
.BI \-s " replstr"
|
|
]
|
|
[
|
|
.BI \-t " device"
|
|
]
|
|
[
|
|
.BI \-x " format"
|
|
]
|
|
.if t .ti +.5i
|
|
[
|
|
.IR pathname \|.\|.\|.
|
|
]
|
|
.br
|
|
.B /usr/5bin/pax
|
|
.B \-rw
|
|
[
|
|
.B \-ilmopuvy
|
|
]
|
|
[
|
|
.BI \-s " replstr"
|
|
]
|
|
[
|
|
.IR pathname \|.\|.\|.
|
|
]
|
|
.I directory
|
|
.SH AVAILABILITY
|
|
.LP
|
|
.B pax
|
|
is available with the
|
|
.I System V
|
|
software installation option.
|
|
Refer to
|
|
.TX INSTALL
|
|
for information on how to install optional software.
|
|
.SH DESCRIPTION
|
|
.IX "pax portable" "" "\fLpax\fP \(em portable archive exchange" ""
|
|
.IX archive "read and write archive files"
|
|
.IX read "archive files"
|
|
.IX write "archive files"
|
|
.LP
|
|
.B pax
|
|
reads and writes archive files which conform to the
|
|
.B "Archive/Interchange File Format"
|
|
specified in
|
|
.I "IEEE Std. 1003.1-1988"
|
|
(\s-1POSIX.1\s0).
|
|
.B pax
|
|
can also read, but not write, a number of other file formats
|
|
in addition to those specified in the
|
|
.B "Archive/Interchange File Format"
|
|
description.
|
|
Support for these traditional file formats, such as V7
|
|
.BR tar (1)
|
|
and System V binary
|
|
.BR cpio (1)
|
|
format archives,
|
|
is provided for backward compatibility and to maximize portability.
|
|
.LP
|
|
.B pax
|
|
will also support traditional
|
|
.B cpio
|
|
and System V
|
|
.B tar
|
|
interfaces if invoked with the name
|
|
.B cpio
|
|
or
|
|
.B tar
|
|
respectively.
|
|
See the
|
|
.BR paxcpio (1V)
|
|
or
|
|
.BR ustar (1V)
|
|
manual pages for more details.
|
|
.LP
|
|
.I directory
|
|
specifies the destination directory pathname for copies when both the
|
|
.B \-r
|
|
and
|
|
.B \-w
|
|
options are specified.
|
|
The directory must exist and be writable before the copy or and error
|
|
results.
|
|
.LP
|
|
.I pathname
|
|
is a file whose contents are used instead of the files
|
|
named on the standard input.
|
|
When a directory is named, all of its files and (recursively)
|
|
subdirectories are copied as well.
|
|
.LP
|
|
A
|
|
.I pattern
|
|
is given in the standard shell pattern matching notation.
|
|
The default if no
|
|
.I pattern
|
|
is specified is
|
|
.RB ` * ',
|
|
which selects all files.
|
|
.LP
|
|
Combinations of the
|
|
.B \-r
|
|
and
|
|
.B \-w
|
|
command line arguments specify whether
|
|
.B pax
|
|
will read, write or list the contents of the specified archive,
|
|
or move the specified files to another directory.
|
|
.LP
|
|
If neither the
|
|
.B \-r
|
|
or
|
|
.B \-w
|
|
options are given,
|
|
.B pax
|
|
will list the contents of the specified archive.
|
|
In this mode,
|
|
.B pax
|
|
lists normal files one per line, hard link pathnames as
|
|
.LP
|
|
.RS
|
|
.IB pathname " == " linkname
|
|
.RE
|
|
.LP
|
|
and symbolic link pathnames (if supported by the implementation) as
|
|
.LP
|
|
.RS
|
|
.IB pathname " \-> " linkname
|
|
.RE
|
|
.LP
|
|
where
|
|
.I pathname
|
|
is the name of the file being extracted, and
|
|
.I linkname
|
|
is the name of a file which appeared earlier in the archive.
|
|
.LP
|
|
If the
|
|
.B \-v
|
|
option is specified, then
|
|
.B pax
|
|
list normal pathnames in the same format used by
|
|
.BR ls (1V)
|
|
with the
|
|
.B \-l
|
|
option.
|
|
Hard links are shown as
|
|
.LP
|
|
.RS
|
|
.IB "<ls \-l listing>" " == " linkname
|
|
.RE
|
|
.LP
|
|
and symbolic links (if supported) are shown as
|
|
.LP
|
|
.RS
|
|
.IB "<ls \-l listing>" " \-> " linkname
|
|
.RE
|
|
.LP
|
|
.B pax
|
|
is capable of reading and writing archives which
|
|
span multiple physical volumes.
|
|
Upon detecting an end of medium on an archive which
|
|
is not yet completed,
|
|
.B pax
|
|
will prompt the user for the next volume of the archive
|
|
and will allow the user to specify the location of the next volume.
|
|
.LP
|
|
When writing to an archive, the
|
|
standard input is used as a list of pathnames if no
|
|
.I pathname
|
|
operands are specified.
|
|
The format is one pathname per line.
|
|
Otherwise, the standard input is the archive file,
|
|
which is formatted according to one of the specifications in
|
|
.B "Archive/Interchange File format"
|
|
in
|
|
.SM POSIX.1\s0,
|
|
or some other implementation-defined format.
|
|
.LP
|
|
The user
|
|
.SM ID
|
|
and group
|
|
.SM ID
|
|
of the process, together with the appropriate
|
|
privileges, affect the ability of
|
|
.B pax
|
|
to restore ownership and permissions attributes of the archived files.
|
|
See
|
|
.I "format-reading utility"
|
|
in
|
|
.B "Archive/Interchange File Format"
|
|
in
|
|
.SM POSIX.1\s0.
|
|
.SH OPTIONS
|
|
.TP
|
|
.B \-w
|
|
Write the files and directories specified by
|
|
.I pathname
|
|
to the standard output together with the pathname and status
|
|
information prescribed by the archive format used.
|
|
.I pathname
|
|
refers to the files and (recursively) subdirectories of that
|
|
directory.
|
|
If
|
|
.I pathname
|
|
is not specified, then the standard input is read to get a
|
|
list of pathnames to copy, one pathname per line.
|
|
In this case, only those pathnames appearing on the standard input are
|
|
copied.
|
|
.TP
|
|
.B \-r
|
|
Read an archive file from the standard input.
|
|
Only files with names that match
|
|
.I pattern
|
|
are selected for extraction.
|
|
The selected files are conditionally created and copied relative to the
|
|
current directory tree, subject to the options described below.
|
|
By default, the owner and group of selected files will be that of the
|
|
invoking process, and the permissions and modification times will be the
|
|
sames as those in the archive.
|
|
.IP
|
|
The supported archive formats are automatically detected on input.
|
|
The default output format is
|
|
.BR ustar ,
|
|
but may be overridden by the
|
|
.BI \-x " format"
|
|
option described below.
|
|
.TP
|
|
.B \-rw
|
|
Read the files and directories named in
|
|
.I pathname
|
|
and copy them to the destination
|
|
.IR directory .
|
|
A directory
|
|
.I pathname
|
|
refers to the files and (recursively) subdirectories of that
|
|
directory.
|
|
If
|
|
.I pathname
|
|
is not specified, the standard input is read to
|
|
get a list of pathnames to copy, one pathname per line.
|
|
In this case, only those pathnames appearing on the standard input are
|
|
copied.
|
|
The directory named by
|
|
.I directory
|
|
must exist and have the proper permissions before the copy can
|
|
occur.
|
|
.TP
|
|
.B \-a
|
|
Append the files specified by
|
|
.I pathname
|
|
to the specified archive.
|
|
.TP
|
|
.B \-c
|
|
Complement the match sense of
|
|
.IR pattern .
|
|
.TP
|
|
.B \-d
|
|
Intermediate directories not explicitly listed in the archive are not
|
|
created.
|
|
This option is ignored unless
|
|
the
|
|
.B \-r
|
|
option is specified.
|
|
.TP
|
|
.B \-i
|
|
Interactively rename files.
|
|
Substitutions specified by the
|
|
.B \-s
|
|
option (described below)
|
|
are performed before requesting the new file name from the user.
|
|
A file is skipped if an empty line is entered and
|
|
.B pax
|
|
exits with an exit status of 0 if an
|
|
.SM EOF
|
|
is encountered.
|
|
.TP
|
|
.B \-l
|
|
Link files rather than copy when possible.
|
|
.TP
|
|
.B \-m
|
|
File modification times are not retained.
|
|
.TP
|
|
.B \-n
|
|
When
|
|
.B \-r
|
|
is specified, but
|
|
.B \-w
|
|
is not, the
|
|
.I pattern
|
|
arguments are treated as ordinary file names.
|
|
Only the first occurrence of each of these files in the input archive
|
|
is read.
|
|
The
|
|
.B pax
|
|
utility exits with a zero exit status after all files in the list have been
|
|
read.
|
|
If one or more files in the list is not found,
|
|
.B pax
|
|
writes a diagnostic to standard error for each of the files and exits with
|
|
a non-zero exit status.
|
|
The file names are compared before any of the
|
|
.BR \-i ,
|
|
.BR \-s ,
|
|
or
|
|
.B \-y
|
|
options are applied.
|
|
.TP
|
|
.B \-o
|
|
Restore file ownership as specified in the archive.
|
|
The invoking process must have appropriate privileges
|
|
to accomplish this.
|
|
.TP
|
|
.B \-p
|
|
Preserve the access time of the input files after they have been copied.
|
|
.TP
|
|
.B \-u
|
|
Copy each file only if it is newer than a pre-existing
|
|
file with the same name.
|
|
This implies the
|
|
.B \-a
|
|
option.
|
|
.TP
|
|
.B \-v
|
|
List file names as they are encountered.
|
|
Produces a verbose table of contents listing
|
|
on the standard output when both the
|
|
.B \-r
|
|
and
|
|
.B \-w
|
|
options are omitted,
|
|
otherwise the file names are printed to standard error as they are
|
|
encountered in the archive.
|
|
.br
|
|
.ne 4
|
|
.TP
|
|
.B \-y
|
|
Interactively prompt for the disposition of each file.
|
|
Substitutions specified by
|
|
.B \-s
|
|
options (described above)
|
|
are performed before prompting the user for disposition.
|
|
.B pax
|
|
exits after receiving an
|
|
.SM EOF
|
|
or an input line starting with the character
|
|
.BR q .
|
|
Files are ignored if an input line starting with anything other than
|
|
.B y
|
|
is specified.
|
|
This option cannot be used in conjunction with the
|
|
.B \-i
|
|
option.
|
|
.br
|
|
.ne 5
|
|
.TP
|
|
.BI \-b " blocking"
|
|
Block the output at
|
|
.I blocking
|
|
bytes per write to the archive file.
|
|
A
|
|
.B k
|
|
suffix multiplies
|
|
.I blocking
|
|
by 1024, a
|
|
.B b
|
|
suffix multiplies
|
|
.I blocking
|
|
by 512 and a
|
|
.B m
|
|
suffix multiplies
|
|
.I blocking
|
|
by 1048576 (1 megabyte).
|
|
If not specified,
|
|
.I blocking
|
|
is automatically determined on input and is ignored if
|
|
the
|
|
.B \-rw
|
|
option is specified.
|
|
.TP
|
|
.BI \-f " archive"
|
|
Specify the pathname of the input or output archive,
|
|
overriding the default of the standard input for the
|
|
.B \-r
|
|
option or the standard output for the
|
|
.B \-w
|
|
option.
|
|
.br
|
|
.ne 5
|
|
.TP
|
|
.BI \-s " replstr"
|
|
File names are modified according to the substitution
|
|
expression using the syntax of
|
|
.BR ed (1)
|
|
as shown:
|
|
.RS
|
|
.RS
|
|
.ft B
|
|
\-s /\fIold\fP/\fInew\fP/[gp]
|
|
.ft R
|
|
.RE
|
|
.RE
|
|
.IP
|
|
Any non-null
|
|
character may be used as a delimiter (a
|
|
.RB ` / '
|
|
is used here as an example).
|
|
Multiple
|
|
.B \-s
|
|
expressions may be specified;
|
|
the expressions are applied in the order specified,
|
|
terminating with the first successful substitution.
|
|
The optional trailing
|
|
.B g
|
|
replaces the
|
|
.I old
|
|
expression each time it occurs in the source string.
|
|
The optional trailing
|
|
.B p
|
|
lists successful mappings on the standard error.
|
|
Files that substitute to an empty string are ignored both on input and
|
|
output.
|
|
.TP
|
|
.BI \-t " device"
|
|
The
|
|
.I device
|
|
option argument is an implementation-defined identifier that names the input
|
|
or output archive device, overriding the default of the standard input for
|
|
.B \-r
|
|
and the standard output for
|
|
.BR \-w .
|
|
.TP
|
|
.BI \-x " format"
|
|
Specifies the output archive
|
|
.IR format .
|
|
The input format, which must be one of the following, is automatically
|
|
determined when the
|
|
.B \-r
|
|
option is used.
|
|
The supported formats are:
|
|
.RS
|
|
.TP
|
|
.I cpio
|
|
The extended
|
|
.I CPIO
|
|
interchange format specified in
|
|
.B "Extended CPIO Format" in
|
|
.I POSIX.1\s0.
|
|
.TP
|
|
.I tar
|
|
The extended
|
|
.I TAR
|
|
interchange format specified in
|
|
.B "Extended TAR Format" in
|
|
.I POSIX.1\s0.
|
|
This is the default archive format.
|
|
.RE
|
|
.LP
|
|
Only the last of multiple
|
|
.B \-f
|
|
or
|
|
.B \-t
|
|
options take effect.
|
|
.LP
|
|
The options
|
|
.BR \-a ,
|
|
.BR \-c ,
|
|
.BR \-d ,
|
|
.BR \-i ,
|
|
.BR \-l ,
|
|
.BR \-p ,
|
|
.BR \-t ,
|
|
.BR \-u ,
|
|
and
|
|
.BR \-y
|
|
are provided for functional compatibility with the historical
|
|
.I cpio
|
|
and
|
|
.I tar
|
|
utilities.
|
|
The option defaults were chosen based on the most common usage of these
|
|
options, therefore, some of the options have meanings different than
|
|
those of the historical commands.
|
|
.SH EXAMPLES
|
|
.LP
|
|
The following command:
|
|
.LP
|
|
.RS
|
|
.ft B
|
|
pax \-w \-f /dev/rmt0 \.
|
|
.ft R
|
|
.RE
|
|
.LP
|
|
copies the contents of the current directory to tape drive 0.
|
|
.br
|
|
.ne 6
|
|
.LP
|
|
The commands:
|
|
.LP
|
|
.RS
|
|
.ft B
|
|
.nf
|
|
mkdir \fInewdir\fP
|
|
cd \fIolddir\fP
|
|
pax \-rw . \fInewdir\fP
|
|
.fi
|
|
.ft R
|
|
.RE
|
|
.LP
|
|
copies the contents of
|
|
.I olddir
|
|
to
|
|
.IR newdir .
|
|
.br
|
|
.ne 8
|
|
.LP
|
|
The command:
|
|
.LP
|
|
.RS
|
|
.ft B
|
|
pax \-r \-s ',\|//*usr//*,\|,' \-f pax.out
|
|
.ft R
|
|
.RE
|
|
.LP
|
|
reads the archive
|
|
.B pax.out
|
|
with all files rooted in
|
|
.B /usr
|
|
in the archive extracted
|
|
relative to the current directory.
|
|
.SH FILES
|
|
.PD 0
|
|
.TP 20
|
|
.B /dev/tty
|
|
used to prompt the user for information when the
|
|
.B \-i
|
|
or
|
|
.B \-y
|
|
options are specified
|
|
.PD
|
|
.SH "SEE ALSO"
|
|
.BR cpio (1),
|
|
.BR ed (1),
|
|
.BR find (1),
|
|
.BR ls (1V),
|
|
.BR paxcpio (1V),
|
|
.BR tar (1),
|
|
.BR ustar (1V),
|
|
.BR cpio (5),
|
|
.BR tar (5)
|
|
.LP
|
|
.I "IEEE Std. 1003.1-1988"
|
|
.SH DIAGNOSTICS
|
|
.LP
|
|
.B pax
|
|
will terminate immediately, without processing any
|
|
additional files on the command line or in the archive.
|
|
.SH "EXIT CODES"
|
|
.LP
|
|
.B pax
|
|
exits with one of the following values:
|
|
.TP
|
|
0
|
|
All files in the archive were processed successfully.
|
|
.TP
|
|
>0
|
|
.B pax
|
|
aborted due to errors encountered during operation.
|
|
.SH BUGS
|
|
.LP
|
|
Special permissions may be required to copy or extract special files.
|
|
.LP
|
|
For device, user
|
|
.SM ID\s0,
|
|
and group
|
|
.SM ID
|
|
numbers larger than 65535 additional
|
|
header records are output.
|
|
These records are ignored by some historical version of
|
|
.BR cpio (1)
|
|
and
|
|
.BR tar (1).
|
|
.LP
|
|
The archive formats described in
|
|
.B "Archive/Interchange File Format"
|
|
have certain restrictions that have
|
|
been carried over from historical usage.
|
|
For example, there are restrictions on the
|
|
length of pathnames stored in the archive.
|
|
.LP
|
|
When getting an
|
|
.RB ` "ls \-l" '
|
|
style listing on
|
|
.B tar
|
|
format archives, link counts are listed as zero since the
|
|
.B ustar
|
|
archive format does not keep link count information.
|
|
.\".SH COPYRIGHT
|
|
.\"Copyright (c) 1989 Mark H. Colburn.
|
|
.\".br
|
|
.\"All rights reserved.
|
|
.\".PP
|
|
.\"Redistribution and use in source and binary forms are permitted
|
|
.\"provided that the above copyright notice is duplicated in all such
|
|
.\"forms and that any documentation, advertising materials, and other
|
|
.\"materials related to such distribution and use acknowledge that the
|
|
.\"software was developed by Mark H. Colburn and sponsored by The
|
|
.\"USENIX Association.
|
|
.\".PP
|
|
.\"THE SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
|
.\"IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
|
.\"WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
|
.SH AUTHOR
|
|
.nf
|
|
Mark H. Colburn
|
|
\s-1NAPS\s0 International
|
|
117 Mackubin Street, Suite 1
|
|
St. Paul, MN 55102
|
|
.fi
|
|
.LP
|
|
Sponsored by
|
|
.B "The USENIX Association"
|
|
for public distribution.
|