Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cpio(1)

find(1)

tar(1)

cpio(4)



  pax(1)                              CLIX                              pax(1)



  NAME

    pax - Portable archive exchange

  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] [pathname ...] directory

    pax-rw [-ilmopuvy] [-s replstr] [pathname ...] directory

  FLAGS

    -a     Appends the files specified by pathname to the specified archive.

    -b blocking
           Blocks the output at blocking bytes per write to the archive file.
           A k suffix multiplies blocking by 1024, a b suffix multiplies
           blocking by 512, and an m suffix multiplies blocking by 1048576 (1
           megabyte).  If not specified, blocking is automatically determined
           on input and is ignored for -rw.

    -c     Complements the match sense of the the pattern operands.

    -d     Does not create intermediate directories not explicitly listed in
           the archive.  This flag is ignored unless the -r flag is specified.

    -f archive
           Specifies the pathname (archive) of the input or output archive,
           overriding the default of standard input for -r or standard output
           for -w.

    -i     Interactively renames files.  Substitutions specified by -s flags
           are performed before requesting the new file name from the user.  A
           file is skipped if an empty line is entered and pax exits with an
           exit status of 0 if EOF is encountered.

    -l     Links files rather than copy them when possible.

    -m     Does not retain file modification times.

    -n     When -r is specified, but -w is not, treats the pattern arguments
           as ordinary file names.  Only the first occurrence of each of these
           files in the input archive is read.  The 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, pax writes a diagnostic
           to standard error for each of the files and exits with a non-zero



  2/94 - Intergraph Corporation                                              1






  pax(1)                              CLIX                              pax(1)



           exit status.  The file names are compared before any of the -i, -s,
           or -y flags are applied.

    -o     Restores file ownership as specified in the archive.  The invoking
           process must have appropriate privileges to accomplish this.

    -p     Preserves the access time of the input files after they have been
           copied.

    -r     Reads an archive file from the standard input.  Only files with
           names that match any of the pattern operands are selected for
           extraction.  The selected files are conditionally created and
           copied relative to the current directory tree, subject to the
           options described later.  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.

           The supported archive formats are automatically detected on input.
           The default output format is ustar, but this may be overridden by
           the -x flag.

    -rw    Reads the files and directories named in the pathname operands and
           copies them to the destination directory.  A directory pathname
           operand refers to the files and (recursively) subdirectories of
           that directory.  If no pathname operands are given, 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 the directory operand
           must exist and have the proper permissions before the copy can
           occur.

    -s replstr
           Modifies file names according to the substitution expression, using
           the syntax of ed(1), as follows:

           -s /old/new/[gp]

           Any non-null character may be used as a delimiteri (a / is used
           here as an example).  Multiple -s expressions may be specified; the
           expressions are applied in the order specified, terminating with
           the first successful substitution.  The optional trailing p causes
           successful mappings to be listed on 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; device is an
           implementation-defined identifier.  This overrides the default of
           standard input for -r and standard output for -w.



  2                                              Intergraph Corporation - 2/94






  pax(1)                              CLIX                              pax(1)



    -u     Copies each file only if it is newer than a pre-existing file with
           the same name.  This implies -a.

    -v     Lists file names as they are encountered.  Produces a verbose table
           of contents listing on the standard output when both the -r and -w
           flags are omitted; otherwise, the file names are printed to
           standard error as they are encountered in the archive.

    -w     Writes the files and directories specified by pathname operands to
           the standard output, together with the pathname and status
           information prescribed by the archive format used.  A directory
           pathname operand refers to the files and (recursively)
           subdirectories of that directory.  If no pathname operands are
           given, 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.

    -x format
           Specifies the output archive format.  The input format, which must
           be one of the following, is automatically determined when the -r
           flag is used.  The supported formats are as follows:

           cpio -- The extended CPIO interchange format specified in Extended
           CPIO Format in ISO/IEC 9945-1:1990 (IEEE Std 1003.1-1990).

           ustar --The extended TAR interchange format specified in Extended
           TAR Format in ISO/IEC 9945-1:1990 (IEEE Std 1003.1-1990).  This is
           the default archive format.

    -y     Interactively prompts for the disposition of each file.
           Substitutions specified by -s flags are performed before prompting
           the user for disposition.

           EOF or an input line starting with the character q cause pax to
           exit.  Otherwise, an input line starting with anything other than y
           causes the file to be ignored.  This flag cannot be used in
           conjunction with the -i flag.

  DESCRIPTION

    The pax utility reads and writes archive files which conform to the
    Archive/Interchange File Format specified in ISO/IEC 9945-1:1990 (IEEE Std
    1003.1-1990).  The pax utility can also read, but not write, a number of
    other file formats in addition to those specified in the
    Archive/Interchange File Format description.  Support for these
    traditional file formats, such as UNIX V7 tar and UNIX System V binary
    cpio format archives, is provided for backward compatibility and to
    maximize portability.

    The pax utility will also support traditional cpio and tar interfaces if
    invoked with the name cpio or tar, respectively.



  2/94 - Intergraph Corporation                                              3






  pax(1)                              CLIX                              pax(1)



    Combinations of the -r and -w command line flags specify whether pax will
    read, write, or list the contents of the specified archive, or move the
    specified files to another directory.

    If neither the -r or -w flags are given, then pax lists the contents of
    the specified archive.  In this mode, pax lists normal files one per line,
    hard link pathnames as

    pathname == linkname,

    and symbolic link pathnames (if supported by the implementation) as

    pathname -> linkname,

    where pathname is the name of the file being extracted, and linkname is
    the name of a file which appeared earlier in the archive.

    If the -v flag is specified, then pax lists
     normal pathnames in the same format used by the ls -l command.  Hard
    links are shown as

    <ls -l listing> == linkname

    and symbolic links (if supported) are shown as

    <ls -l listing> -> linkname

    The pax utility 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, 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.

    Only the last of multiple -f or -t flags take effect.

    When writing to an archive, the standard input is used as a list of
    pathnames if no 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
    Archive/Interchange File Format in ISO/IEC 9945-1:1990 (IEEE Std 1003.1-
    1990).  or 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 ISO/IEC 9945-1:1990 (IEEE Std 1003.1-
    1990).

    The flags -a, -c -d, -i, -l -p, -t, -u, and -y are provided for functional
    compatibility with the historical cpio and tar utilities.  The flag
    defaults were chosen based on the most common usage of these flags;



  4                                              Intergraph Corporation - 2/94






  pax(1)                              CLIX                              pax(1)



    therefore, some of the flags have meanings different than those of the
    historical commands.

  Operands

    The following operands are available:

    directory
           The destination directory pathname for copies when both the -r and
           -w options are specified.  The directory must exist and be writable
           before the copy or and error results.

    pathname
           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.

    pattern
           A pattern is given in the standard shell pattern matching notation.
           The default if no pattern is specified is * \*O, which selects all
           files.

  EXAMPLES

    1.  The following command copies the contents of the current directory to
        tape drive 0:

        $ pax -w -f /dev/rmt0 .


    2.  The following commands copy the contents of olddir to newdir:

        $ mkdir newdir
        $ cd olddir
        $ pax -rw . newdir


    3.  The following command reads the archive pax.out, with all files rooted
        in /usr in the archive extracted relative to the current directory:

        $ pax -r -s ',//*usr//*,,' -f pax.out


  NOTES

    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.  These records are ignored by some historical
    versions of cpio(1) and tar(1).




  2/94 - Intergraph Corporation                                              5






  pax(1)                              CLIX                              pax(1)



    The archive formats described in 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.

    When getting an ls -l style listing on tar format archives, link counts
    are listed as zero since the ustar archive format does not keep link count
    information.

  FILES

    /dev/tty
           Used to prompt the user for information when the -i or -y flags are
           specified.

  COPYRIGHT

    Copyright © 1989 Mark H. Colburn, all rights reserved.

    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.

  RELATED INFORMATION

    Commands:  cpio(1), find(1), tar(1)

    Files:  cpio(4)

    ISO/IEC 9945-1:1990 (IEEE Std 1003.1-1990).






















  6                                              Intergraph Corporation - 2/94




Typewritten Software • bear@typewritten.org • Edmonds, WA 98026