home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / unix / pax2exe.zoo / pax.man < prev    next >
Encoding:
Text File  |  1990-02-27  |  15.5 KB  |  463 lines

  1.  
  2.  
  3.  
  4. PAX(1)              UNIX Programmer's Manual               PAX(1)
  5.  
  6.  
  7.  
  8. NAME
  9.      pax - portable archive exchange
  10.  
  11. SYNOPSIS
  12.      pax [-cimopuvy] [-f archive] [-s replstr] [-t device] [pat-
  13.          tern...]
  14.  
  15.      pax -r [-cimnopuvy] [-f archive] [-s replstr] [-t device]
  16.             [pattern...]
  17.  
  18.      pax -w [-adimuvy] [-b blocking] [-f archive] [-s replstr]
  19.             [-t device] [-x format] [pathname...]
  20.  
  21.      pax -rw [-ilmopuvy] [-s replstr] [pathname...] directory
  22.  
  23. DESCRIPTION
  24.      Pax reads and writes archive files which conform to the
  25.      Archive/Interchange File Format specified in IEEE Std.
  26.      1003.1-1988.  Pax can also read, but not write, a number of
  27.      other file formats in addition to those specified in the
  28.      Archive/Interchange File Format description.  Support for
  29.      these traditional file formats, such as V7 tar and System V
  30.      binary cpio format archives, is provided for backward compa-
  31.      tibility and to maximize portability.
  32.  
  33.      Pax will also support traditional cpio and System V tar
  34.      interfaces if invoked with the name "cpio" or "tar" respec-
  35.      tively.  See the cpio(1) or tar(1) manual pages for more
  36.      details.
  37.  
  38.      Combinations of the -r and -w command line arguments specify
  39.      whether pax will read, write or list the contents of the
  40.      specified archive, or move the specified files to another
  41.      directory.
  42.  
  43.      The command line arguments are:
  44.  
  45.      -w   writes the files and directories specified by pathname
  46.           operands to the standard output together with the path-
  47.           name and status information prescribed by the archive
  48.           format used.  A directory pathname operand refers to
  49.           the files and (recursively) subdirectories of that
  50.           directory.  If no pathname operands are given, then the
  51.           standard input is read to get a list of pathnames to
  52.           copy, one pathname per line.  In this case, only those
  53.           pathnames appearing on the standard input are copied.
  54.  
  55.      -r   Pax reads an archive file from the standard input.
  56.           Only files with names that match any of the pattern
  57.           operands are selected for extraction.  The selected
  58.           files are conditionally created and copied relative to
  59.           the current directory tree, subject to the options
  60.  
  61.  
  62.  
  63. Printed 2/26/90                                                 1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PAX(1)              UNIX Programmer's Manual               PAX(1)
  71.  
  72.  
  73.  
  74.           described below.  By default, the owner and group of
  75.           selected files will be that of the invoking process,
  76.           and the permissions and modification times will be the
  77.           sames as those in the archive.
  78.  
  79.           The supported archive formats are automatically
  80.           detected on input.  The default output format is ustar,
  81.           but may be overridden by the -x format option described
  82.           below.
  83.  
  84.      -rw  Pax reads the files and directories named in the path-
  85.           name operands and copies them to the destination direc-
  86.           tory.  A directory pathname operand refers to the files
  87.           and (recursively) subdirectories of that directory.  If
  88.           no pathname operands are given, the standard input is
  89.           read to get a list of pathnames to copy, one pathname
  90.           per line.  In this case, only those pathnames appearing
  91.           on the standard input are copied.  The directory named
  92.           by the directory operand must exist and have the proper
  93.           permissions before the copy can occur.
  94.  
  95.      If neither the -r or -w options are given, then pax will
  96.      list the contents of the specified archive.  In this mode,
  97.      pax lists normal files one per line, hard link pathnames as
  98.  
  99.                pathname == linkname
  100.  
  101.      and symbolic link pathnames (if supported by the implementa-
  102.      tion) as
  103.  
  104.                pathname -> linkname
  105.  
  106.      where pathname is the name of the file being extracted, and
  107.      linkname is the name of a file which appeared earlier in the
  108.      archive.
  109.  
  110.      If the -v option is specified, then pax list normal path-
  111.      names in the same format used by the ls utility with the -l
  112.      option.  Hard links are shown as
  113.  
  114.                <ls -l listing> == linkname
  115.  
  116.      and symbolic links (if supported) are shown as
  117.  
  118.                <ls -l listing> -> linkname
  119.  
  120.  
  121.      Pax is capable of reading and writing archives which span
  122.      multiple physical volumes.  Upon detecting an end of medium
  123.      on an archive which is not yet completed, pax will prompt
  124.      the user for the next volume of the archive and will allow
  125.      the user to specify the location of the next volume.
  126.  
  127.  
  128.  
  129. Printed 2/26/90                                                 2
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. PAX(1)              UNIX Programmer's Manual               PAX(1)
  137.  
  138.  
  139.  
  140.      Options
  141.      The following options are available:
  142.  
  143.      -a        The files specified by pathname are appended to
  144.                the specified archive.
  145.  
  146.      -b blocking
  147.                Block the output at blocking bytes per write to
  148.                the archive file.  A k suffix multiplies blocking
  149.                by 1024, a b suffix multiplies blocking by 512 and
  150.                a m suffix multiplies blocking by 1048576 (1 mega-
  151.                byte).  For machines with 16-bit int's (VAXen,
  152.                XENIX-286, etc.), the maximum buffer size is 32k-
  153.                1.  If not specified, blocking is automatically
  154.                determined on input and is ignored for -rw.
  155.  
  156.      -c        Complement the match sense of the pattern
  157.                operands.
  158.  
  159.      -d        Intermediate directories not explicitly listed in
  160.                the archive are not created.  This option is
  161.                ignored unless the -r option is specified.
  162.  
  163.      -f archive
  164.                The archive option specifies the pathname of the
  165.                input or output archive, overriding the default of
  166.                standard input for -r or standard output for -w.
  167.  
  168.      -i        Interactively rename files.  Substitutions speci-
  169.                fied by -s options (described below) are performed
  170.                before requesting the new file name from the user.
  171.                A file is skipped if an empty line is entered and
  172.                pax exits with an exit status of 0 if EOF is
  173.                encountered.
  174.  
  175.      -l        Files are linked rather than copied when possible.
  176.  
  177.      -m        File modification times are not retained.
  178.  
  179.      -n        When -r is specified, but -w is not, the pattern
  180.                arguments are treated as ordinary file names.
  181.                Only the first occurrence of each of these files
  182.                in the input archive is read.  The pax utility
  183.                exits with a zero exit status after all files in
  184.                the list have been read.  If one or more files in
  185.                the list is not found, pax writes a diagnostic to
  186.                standard error for each of the files and exits
  187.                with a non-zero exit status.  the file names are
  188.                compared before any of the -i, -s, or -y options
  189.                are applied.
  190.  
  191.      -o        Restore file ownership as specified in the
  192.  
  193.  
  194.  
  195. Printed 2/26/90                                                 3
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. PAX(1)              UNIX Programmer's Manual               PAX(1)
  203.  
  204.  
  205.  
  206.                archive.  The invoking process must have appropri-
  207.                ate privileges to accomplish this.
  208.  
  209.      -p        Preserve the access time of the input files after
  210.                they have been copied.
  211.  
  212.      -s replstr
  213.                File names are modified according to the substitu-
  214.                tion expression using the syntax of ed(1) as
  215.                shown:
  216.  
  217.                          -s /old/new/[gp]
  218.  
  219.                Any non null character may be used as a delimiter
  220.                (a / is used here as an example).  Multiple -s
  221.                expressions may be specified; the expressions are
  222.                applied in the order specified terminating with
  223.                the first successful substitution.  The optional
  224.                trailing p causes successful mappings to be listed
  225.                on standard error.  The optional trailing g causes
  226.                the old expression to be replaced each time it
  227.                occurs in the source string.  Files that substi-
  228.                tute to an empty string are ignored both on input
  229.                and output.
  230.  
  231.      -t device The device option argument is an implementation-
  232.                defined identifier that names the input or output
  233.                archive device, overriding the default of standard
  234.                input for -r and standard output for -w.
  235.  
  236.      -u        Copy each file only if it is newer than a pre-
  237.                existing file with the same name.  This implies
  238.                -a.
  239.  
  240.      -v        List file names as they are encountered.  Produces
  241.                a verbose table of contents listing on the stan-
  242.                dard output when both -r and -w are omitted, oth-
  243.                erwise the file names are printed to standard
  244.                error as they are encountered in the archive.
  245.  
  246.      -x format Specifies the output archive format.  The input
  247.                format, which must be one of the following, is
  248.                automatically determined when the -r option is
  249.                used.  The supported formats are:
  250.  
  251.                cpio   The extended CPIO interchange format speci-
  252.                       fied in Extended CPIO Format in IEEE Std.
  253.                       1003.1-1988.
  254.  
  255.                ustar  The extended TAR interchange format speci-
  256.                       fied in Extended TAR Format in IEEE Std.
  257.                       1003.1-1988. This is the default archive
  258.  
  259.  
  260.  
  261. Printed 2/26/90                                                 4
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. PAX(1)              UNIX Programmer's Manual               PAX(1)
  269.  
  270.  
  271.  
  272.                       format.
  273.  
  274.      -y        Interactively prompt for the disposition of each
  275.                file.  Substitutions specified by -s options
  276.                (described above) are performed before prompting
  277.                the user for disposition.  EOF or an input line
  278.                starting with the character q caused pax to exit.
  279.                Otherwise, an input line starting with anything
  280.                other than y causes the file to be ignored.  This
  281.                option cannot be used in conjunction with the -i
  282.                option.
  283.  
  284.      Only the last of multiple -f or -t options take effect.
  285.  
  286.      When writing to an archive, the standard input is used as a
  287.      list of pathnames if no pathname operands are specified.
  288.      The format is one pathname per line.  Otherwise, the stan-
  289.      dard input is the archive file, which is formatted according
  290.      to one of the specifications in Archive/Interchange File
  291.      format in IEEE Std. 1003.1-1988, or some other
  292.      implementation-defined format.
  293.  
  294.      The user ID and group ID of the process, together with the
  295.      appropriate privileges, affect the ability of pax to restore
  296.      ownership and permissions attributes of the archived files.
  297.      (See format-reading utility in Archive/Interchange File For-
  298.      mat in IEEE Std. 1003.1-1988.)
  299.  
  300.      The options -a, -c, -d, -i, -l, -p, -t, -u, and -y are pro-
  301.      vided for functional compatibility with the historical cpio
  302.      and tar utilities.  The option defaults were chosen based on
  303.      the most common usage of these options, therefore, some of
  304.      the options have meanings different than those of the his-
  305.      torical commands.
  306.  
  307.      Operands
  308.      The following operands are available:
  309.  
  310.      directory The destination directory pathname for copies when
  311.                both the -r and -w options are specified.  The
  312.                directory must exist and be writable before the
  313.                copy or and error results.
  314.  
  315.      pathname  A file whose contents are used instead of the
  316.                files named on the standard input.  When a direc-
  317.                tory is named, all of its files and (recursively)
  318.                subdirectories are copied as well.
  319.  
  320.      pattern   A pattern is given in the standard shell pattern
  321.                matching notation.  The default if no pattern is
  322.                specified is *, which selects all files.
  323.  
  324.  
  325.  
  326.  
  327. Printed 2/26/90                                                 5
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. PAX(1)              UNIX Programmer's Manual               PAX(1)
  335.  
  336.  
  337.  
  338. EXAMPLES
  339.      The following command
  340.  
  341.                pax -w -f /dev/rmt0 .
  342.  
  343.      copies the contents of the current directory to tape drive
  344.      0.
  345.  
  346.      The commands
  347.  
  348.                mkdir newdir
  349.                cd olddir
  350.                pax -rw . newdir
  351.  
  352.      copies the contents of olddir to newdir .
  353.  
  354.      The command
  355.  
  356.                pax -r -s ',//*usr//*,,' -f pax.out
  357.  
  358.      reads the archive pax.out with all files rooted in "/usr" in
  359.      the archive extracted relative to the current directory.
  360.  
  361. FILES
  362.      /dev/tty  used to prompt the user for information when the
  363.                -i or -y options are specified.
  364.  
  365. SEE ALSO
  366.      cpio(1), find(1), tar(1), cpio(5), tar(5)
  367.  
  368. DIAGNOSTICS
  369.      Pax will terminate immediately, without processing any addi-
  370.      tional files on the command line or in the archive.
  371.  
  372. EXIT CODES
  373.      Pax will exit with one of the following values:
  374.  
  375.      0    All files in the archive were processed successfully.
  376.  
  377.      >0   Pax aborted due to errors encountered during operation.
  378.  
  379. BUGS
  380.      Special permissions may be required to copy or extract spe-
  381.      cial files.
  382.  
  383.      Device, user ID, and group ID numbers larger than 65535
  384.      cause additional header records to be output.  These records
  385.      are ignored by some historical version of cpio(1) and
  386.      tar(1).
  387.  
  388.      The archive formats described in Archive/Interchange File
  389.      Format have certain restrictions that have been carried over
  390.  
  391.  
  392.  
  393. Printed 2/26/90                                                 6
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. PAX(1)              UNIX Programmer's Manual               PAX(1)
  401.  
  402.  
  403.  
  404.      from historical usage.  For example, there are restrictions
  405.      on the length of pathnames stored in the archive.
  406.  
  407.      When getting an "ls -l" style listing on tar format
  408.      archives, link counts are listed as zero since the ustar
  409.      archive format does not keep link count information.
  410.  
  411.      On 16 bit architectures, the largest buffer size is 32k-1.
  412.      This is due, in part, to using integers in the buffer allo-
  413.      cation schemes, however, on many of these machines, it is
  414.      not possible to allocate blocks of memory larger than 32k.
  415.  
  416. COPYRIGHT
  417.      Copyright (c) 1989 Mark H. Colburn.
  418.      All rights reserved.
  419.  
  420.      Redistribution and use in source and binary forms are per-
  421.      mitted provided that the above copyright notice is dupli-
  422.      cated in all such forms and that any documentation,
  423.      advertising materials, and other materials related to such
  424.      distribution and use acknowledge that the software was
  425.      developed by Mark H. Colburn.
  426.  
  427.      THE SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS
  428.      OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE
  429.      IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PAR-
  430.      TICULAR PURPOSE.
  431.  
  432. AUTHOR
  433.      Mark H. Colburn
  434.      Minnetech Consulting, Inc.
  435.      3232 Aquila Lane
  436.      St. Louis Park, MN 55426
  437.  
  438.      mark@Minnetech.MN.ORG
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459. Printed 2/26/90                                                 7
  460.  
  461.  
  462.  
  463.