pax(1) pax(1)NAME pax - copies files to or from an archive in an IEEE format SYNOPSIS pax [-cimopuvy] [-f archive] [-s replstr] [-t device] [pattern]... pax -r [-cimnopuvy] [-f archive] [-s replstr] [-t device] [pattern]... pax -w [-adimuvy] [-b blocking] [-f archive] [-s replstr] [-t device] [-x format] [path]... pax -rw [-ilmopuvy] [-s replstr] [path]... directory ARGUMENTS -a Appends the files specified by path to the specified archive. -b blocking Blocks the output to the archive file at the number of bytes specified by blocking. A k suffix multiplies the value of blocking by 1024, a b suffix multiplies blocking by 512, and an m suffix multiplies by 1048576 (1 megabyte). For computers with 16-bit integers, the maximum buffer size is one byte less than 32K. If the value of blocking is not specified, it is automatically determined on input and is ignored for -rw. -c Excludes the files and directories that match the pattern argument. -d Instructs pax not to create intermediate directories not explicitly listed in the archive. This option is ignored unless the -r option is specified. directory Specifies the destination directory for files copied with pax. To invoke this mode, use both the -r and the -w options. The directory must exist and be writable before the copy is made; otherwise, an error results. -f archive Specifies archive as the path of the input or output archive and overrides the default of standard input for -r or standard output for -w. -i Interactively renames files. The pax command performs substitutions specified by the -s option before requesting the new filename from the user. The pax command skips a file if an empty line is entered and exits with an exit status of 0 if it encounters the January 1992 1
pax(1) pax(1)end-of-file signal. -l Links files instead of copying them, when possible. -m Instructs pax not to retain file modification times. -n Instructs pax to treat the pattern arguments as ordinary filenames, when -r is specified, but -w is not. Only the first occurrence of each of these files in the input archive is read. The pax utility exits with an exit status of 0 after reading all files in the list. If one or more files in the list are not found, pax writes a message to standard error for each of the files and exits with a nonzero exit status. The filenames are compared before any of the -i, -s, or -y options that are present are applied. -o Restores file ownership as specified in the archive. The invoking process must have appropriate privileges restore file ownership. -p Preserves the access time of the input files after they have been copied. path Specifies a file to be copied into the archive instead of the files named on the standard input. When a directory is specified, pax recursively copies all the files and subdirectories of path as well. pattern Specifies, in the standard notation for shell filename generation, particular files to be read from an archive. If you do not specify a value for pattern, pax selects all files by default. -r Causes pax to read an archive file from the standard input. Only files with names that match any of the pattern arguments are selected for extraction. The selected files are conditionally created and copied relative to the current directory tree, subject to the other options specified. By default, the owner and group of selected files are those of the invoking process, and the permissions and modification times are the same as those in the archive. The supported archive formats are automatically detected on input. The default output format is ustar, but you can override this default by using the -x option. -rw Causes pax to read the files and directories referred to in path and copy them to the destination specified 2 January 1992
pax(1) pax(1)by directory. The placeholder path refers to the files and (recursively) subdirectories of that directory. If the value of path is not given, the standard input is read to get a list of paths to copy, one path per line. In this case, only those paths appearing on the standard input are copied. The directory directory must exist and have the proper permissions before copying can occur. -s replstr Modifies filenames according to the substitution string, using the syntax of ed(1), as in this example: pax -rs /old/new/[gp] Any non-null character can be used as a delimiter. In the example shown, / is the delimiter. You can specify multiple -s expressions; the expressions are applied in the order specified, terminating with the first successful substitution. The optional trailing p causes successful mappings to be listed to standard error. The optional trailing g causes the old expression to be replaced each time it occurs in the source string. Files that substitute to an empty string are ignored both on input and output. -t device Names the input or output archive device by using the device argument as an implementation-defined identifier. This option overrides the default of standard input for -r and standard output for -w. -u Copies each file only if it is newer than a pre- existing file with the same name. This output is used in conjunction with the -a option. -v Lists filenames as they are encountered. This option produces a verbose list of the table of contents on the standard output when both the -r and -w options are omitted; otherwise, the filenames are printed to standard error as they are encountered in the archive. -x format Specifies the format of the output archive. The input format, which must be one of those listed here, is automatically determined when the -r option is used. These formats are supported: cpio The extended CPIO interchange format specified in ``Extended CPIO Format'' in IEEE Standard 1003.1- 1988. January 1992 3
pax(1) pax(1)ustar The extended TAR interchange format specified in ``Extended TAR Format'' in IEEE Standard 1003.1- 1988. This is the default archive format. -w Writes the files and directories specified by path arguments to the standard output, together with the path and status information prescribed by the archive format used. If the argument path refers to a directory, pax recursively traverses all the files and subdirectories of path as well. If path is not given, then the standard input is read to get a list of paths to copy, one path per line. In this case, only those paths appearing on the standard input are copied. -y Interactively prompts for the disposition of each file. Substitutions specified by -s options (described earlier in this list) are performed before the user is prompted for disposition. The end-of-file signal or an input line starting with the character q after the prompt causes pax to exit. Otherwise, an input line starting with anything other than the -y option causes the file to be ignored. This option cannot be used in conjunction with the -i option. DESCRIPTION pax reads and writes archive files that conform to the description in ``Archive/Interchange File Format'' specified in IEEE Standard 1003.1-1988. The pax utility can also read, but not write, a number of other file formats in addition to those specified in ``Archive/Interchange File Format.'' Support for these traditional file formats, such as V7 tar and System V cpio, is provided for backward compatibility and maximum portability. The pax command also supports traditional cpio and tar interfaces if invoked with the name cpio or tar, respectively. See cpio(1) or tar(1) for more details. Combinations of the -r and -w options specify whether pax reads, writes, or lists the contents of the specified archive, or moves the specified files to another directory. If neither the -r nor the -w option is given, then pax lists the contents of the specified archive. In this mode, pax lists normal files one per line, lists nonsymbolic link paths as path == link and lists symbolic link paths, if supported by the implementation, as 4 January 1992
pax(1) pax(1)path -> link where path is the name of the file being extracted and link is the name of a file that appeared earlier in the archive. If the -v option is specified, then pax lists normal paths in the same format as that used by the ls utility when ls is invoked with the -l option. Nonsymbolic links are shown as follows: <listing> == link Symbolic links, if supported, are shown as follows: <listing> -> link You can use the pax command to read and write archives that span multiple physical volumes. Upon detecting an end-of- medium signal on an archive that is not yet complete, pax prompts you for the next volume of the archive and allows you to specify the location of the next volume. Only the last instance of multiple -f or -t options takes effect. When pax writes to an archive, the standard input is used as a list of paths if path is not specified. The format is one path per line. Otherwise, the standard input is the archive file, which is formatted according to one of the specifications in ``Archive/Interchange File Format'' in IEEE Standard 1003.1-1988 or according to some other implementation-defined format. The user ID and group ID of the process, together with the appropriate privileges, affect the ability of pax to restore ownership and permissions attributes of the archived files. (See ``Format-reading Utility'' in ``Archive/Interchange File Format,'' in IEEE Standard 1003.1-1988.) The options -a, -c, -d, -i, -l, -p, -t, -u, and -y are provided for functional compatibility with the historical cpio and tar utilities. The option defaults reflect the most common usage of these options; therefore, some of the options have meanings different from those of the historical commands. EXAMPLES To copy the contents of the current directory to tape drive 0, use the following command: pax -w -f /dev/rmt0 January 1992 5
pax(1) pax(1)To copy the contents of olddir to newdir, use the following command: mkdir newdir cd olddir pax -rw . newdir The following command reads the archive pax.out. All archive files below /usr are extracted relative to the current directory. pax -r -s ',/usr/*,,' -f pax.out In this example, the substitution string delimiter is the comma. STATUS MESSAGES AND VALUES The pax program exits with one of two types of values. If all of the files in the archive were processed successfully, pax exits with a value of 0. If pax terminated because of errors encountered during operation, pax exits with a nonzero value. LIMITATIONS Special permissions may be required to copy or extract special files. Device, user ID, and group ID numbers larger than 65535 cause additional header records to be output. Some historical versions of cpio(1) and tar(1) ignore these records. Certain historical restrictions apply to the archive formats described in ``Archive/Interchange File Format.'' For example, the length of paths stored in the archive is restricted. In ls -l style listings of tar format archives, link counts are listed as 0 because the ustar archive format does not keep link-count information. In the event of errors, pax terminates immediately, without processing any additional files on the command line or in the archive. NOTES Portions of this manual page were previously copyrighted (c) 1989 by Mark H. Colburn. Public distribution has been sponsored by the USENIX Association. 6 January 1992
pax(1) pax(1)FILES /usr/bin/pax Executable file SEE ALSO cpio(1), find(1), tar(1) cpio(4), tar(4) in A/UX Programmer's Reference January 1992 7