home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / archiver / tar.arj / TAR.MAN < prev   
Encoding:
Text File  |  1991-06-26  |  12.9 KB  |  331 lines

  1. TAR(1)              UNIX Programmer's Manual               TAR(1)
  2.  
  3.  
  4.  
  5. NAME
  6.      tar - tape (or other media) file archiver
  7.  
  8. SYNOPSIS
  9.      tar -[BcdDhiklmopRstvxzZ] [-b N] [-f F] [-T F] [ filename or
  10.      regexp ...  ]
  11.  
  12. DESCRIPTION
  13.      tar provides a way to store many files into a single
  14.      archive, which can be kept in another Unix file, stored on
  15.      an I/O device such as tape, floppy, cartridge, or disk, sent
  16.      over a network, or piped to another program.  It is useful
  17.      for making backup copies, or for packaging up a set of files
  18.      to move them to another system.
  19.  
  20.      tar has existed since Version 7 Unix with very little
  21.      change.  It has been proposed as the standard format for
  22.      interchange of files among systems that conform to the IEEE
  23.      P1003 ``Portable Operating System'' standard.
  24.  
  25.      This version of tar supports some of the extensions which
  26.      were proposed in the P1003 draft standards, including owner
  27.      and group names, and support for named pipes, fifos, con-
  28.      tiguous files, and block and character devices.
  29.  
  30.      When reading an archive, this version of tar continues after
  31.      finding an error.  Previous versions required the `i' option
  32.      to ignore checksum errors.
  33.  
  34. OPTIONS
  35.      tar options can be specified in either of two ways.  The
  36.      usual Unix conventions can be used: each option is preceded
  37.      by `-'; arguments directly follow each option; multiple
  38.      options can be combined behind one `-' as long as they take
  39.      no arguments.  For compatability with the Unix tar program,
  40.      the options may also be specified as ``keyletters,'' wherein
  41.      all the option letters occur in the first argument to tar,
  42.      with no `-', and their arguments, if any, occur in the
  43.      second, third, ...  arguments.  Examples:
  44.  
  45.      Normal:  tar -f arcname -cv file1 file2
  46.  
  47.      Old:  tar fcv arcname file1 file2
  48.  
  49.      At least one of the -c, -t, -d, or -x options must be
  50.      included.  The rest are optional.
  51.  
  52.      Files to be operated upon are specified by a list of file
  53.      names, which follows the option specifications (or can be
  54.      read from a file by the -T option).  Specifying a directory
  55.      name causes that directory and all the files it contains to
  56.      be (recursively) processed.  If a full path name is speci-
  57.      fied when creating an archive, it will be written to the
  58.      archive without the initial "/", to allow the files to be
  59.      later read into a different place than where they were
  60.  
  61.  
  62.  
  63. Printed 5/26/91          5 November 1987                        1
  64.  
  65.  
  66.  
  67. TAR(1)              UNIX Programmer's Manual               TAR(1)
  68.  
  69.  
  70.  
  71.      dumped from, and a warning will be printed.  If files are
  72.      extracted from an archive which contains full path names,
  73.      they will be extracted relative to the current directory and
  74.      a warning message printed.
  75.  
  76.      When extracting or listing files, the ``file names'' are
  77.      treated as regular expressions, using mostly the same syntax
  78.      as the shell.  The shell actually matches each substring
  79.      between ``/''s separately, while tar matches the entire
  80.      string at once, so some anomalies will occur; e.g. ``*'' or
  81.      ``?'' can match a ``/''.  To specify a regular expression as
  82.      an argument to tar, quote it so the shell will not expand
  83.      it.
  84.  
  85.      -b N Specify a blocking factor for the archive.  The block
  86.           size will be N x 512 bytes.  Larger blocks typically
  87.           run faster and let you fit more data on a tape.  The
  88.           default blocking factor is set when tar is compiled,
  89.           and is typically 20.  There is no limit to the maximum
  90.           block size, as long as enough memory can be allocated
  91.           for it, and as long as the device containing the
  92.           archive can read or write that block size.
  93.  
  94.      -B   When reading an archive, reblock it as we read it.
  95.           Normally, tar reads each block with a single read(2)
  96.           system call.  This does not work when reading from a
  97.           pipe or network socket under Berkeley Unix; read(2)
  98.           only gives as much data as has arrived at the moment.
  99.           With this option, it will do multiple read(2)s to fill
  100.           out to a record boundary, rather than reporting an
  101.           error.  This option is default when reading an archive
  102.           from standard input, or over a network.
  103.  
  104.      -c   Create an archive from a list of files.
  105.  
  106.      -d   Diff an archive against the files in the file system.
  107.           Reports differences in file size, mode, uid, gid, and
  108.           contents.  If a file exists on the tape, but not in the
  109.           file system, that is reported.  This option needs
  110.           further work to be really useful.
  111.  
  112.      -D   When creating an archive, only dump each directory
  113.           itself; don't dump all the files inside the directory.
  114.           In conjunction with find(1), this is useful in creating
  115.           incremental dumps for archival backups, similar to
  116.           those produced by dump(8).
  117.  
  118.      -f F Specify the filename of the archive.  If the specified
  119.           filename is ``-'', the archive is read from the stan-
  120.           dard input or written to the standard output.  If the
  121.           -f option is not used, and the environment variable
  122.           TAPE exists, its value will be used; otherwise, a
  123.           default archive name (which was picked when tar was
  124.           compiled) is used.  The default is normally set to the
  125.           ``first'' tape drive or other transportable I/O medium
  126.  
  127.  
  128.  
  129. Printed 5/26/91          5 November 1987                        2
  130.  
  131.  
  132.  
  133. TAR(1)              UNIX Programmer's Manual               TAR(1)
  134.  
  135.  
  136.  
  137.           on the system.
  138.  
  139.           If the filename contains a colon before a slash, it is
  140.           interpreted as a ``hostname:/file/name'' pair.  tar
  141.           will invoke the commands rsh and dd to access the
  142.           specified file or device on the system hostname.  If
  143.           you need to do something unusual like rsh with a dif-
  144.           ferent user name, use ``-f -'' and pipe it to rsh manu-
  145.           ally.
  146.  
  147.      -h   When creating an archive, if a symbolic link is encoun-
  148.           tered, dump the file or directory to which it points,
  149.           rather than dumping it as a symbolic link.
  150.  
  151.      -i   When reading an archive, ignore blocks of zeros in the
  152.           archive.  Normally a block of zeros indicates the end
  153.           of the archive, but in a damaged archive, or one which
  154.           was created by appending several archives, this option
  155.           allows tar to continue.  It is not on by default
  156.           because there is garbage written after the zeroed
  157.           blocks by the Unix tar program.  Note that with this
  158.           option set, tar will read all the way to the end of the
  159.           file, eliminating problems with multi-file tapes.
  160.  
  161.      -k   When extracting files from an archive, keep existing
  162.           files, rather than overwriting them with the version
  163.           from the archive.
  164.  
  165.      -l   When dumping the contents of a directory to an archive,
  166.           stay within the local file system of that directory.
  167.           This option only affects the files dumped because they
  168.           are in a dumped directory; files named on the command
  169.           line are always dumped, and they can be from various
  170.           file systems.  This is useful for making ``full dump''
  171.           archival backups of a file system, as with the dump(8)
  172.           command.  Files which are skipped due to this option
  173.           are mentioned on the standard error.
  174.  
  175.      -m   When extracting files from an archive, set each file's
  176.           modified timestamp to the current time, rather than
  177.           extracting each file's modified timestamp from the
  178.           archive.
  179.  
  180.      -o   When creating an archive, write an old format archive,
  181.           which does not include information about directories,
  182.           pipes, fifos, contiguous files, or device files, and
  183.           specifies file ownership by uid's and gid's rather than
  184.           by user names and group names.  In most cases, a
  185.           ``new'' format archive can be read by an ``old'' tar
  186.           program without serious trouble, so this option should
  187.           seldom be needed.
  188.  
  189.      -p   When extracting files from an archive, restore them to
  190.           the same permissions that they had in the archive.  If
  191.           -p is not specified, the current umask limits the
  192.  
  193.  
  194.  
  195. Printed 5/26/91          5 November 1987                        3
  196.  
  197.  
  198.  
  199. TAR(1)              UNIX Programmer's Manual               TAR(1)
  200.  
  201.  
  202.  
  203.           permissions of the extracted files.  See umask(2).
  204.  
  205.      -R   With each message that tar produces, print the record
  206.           number within the archive where the message occurred.
  207.           This option is especially useful when reading damaged
  208.           archives, since it helps to pinpoint the damaged sec-
  209.           tion.
  210.  
  211.      -s   When specifying a list of filenames to be listed or
  212.           extracted from an archive, the -s flag specifies that
  213.           the list is sorted into the same order as the tape.
  214.           This allows a large list to be used, even on small
  215.           machines, because the entire list need not be read into
  216.           memory at once.  Such a sorted list can easily be
  217.           created by running ``tar -t'' on the archive and edit-
  218.           ing its output.
  219.  
  220.      -t   List a table of contents of an existing archive.  If
  221.           file names are specified, just list files matching the
  222.           specified names.  The listing appears on the standard
  223.           output.
  224.  
  225.      -T F Rather than specifying file names or regular expres-
  226.           sions as arguments to the tar command, this option
  227.           specifies that they should be read from the file F, one
  228.           per line.  If the file name specified is ``-'', the
  229.           list is read from the standard input.  This option, in
  230.           conjunction with the -s option, allows an arbitrarily
  231.           large list of files to be processed, and allows the
  232.           list to be piped to tar.
  233.  
  234.      -v   Be verbose about the files that are being processed or
  235.           listed.  Normally, archive creation, file extraction,
  236.           and differencing are silent, and archive listing just
  237.           gives file names.  The -v option causes an ``ls
  238.           -l''-like listing to be produced.  The output from -v
  239.           appears on the standard output except when creating an
  240.           archive (since the new archive might be on standard
  241.           output), where it goes to the standard error output.
  242.  
  243.      -V   Print the version and authors of the program.
  244.  
  245.      -x   Extract files from an existing archive.  If file names
  246.           are specified, just extract files matching the speci-
  247.           fied names, otherwise extract all the files in the
  248.           archive.
  249.  
  250.      -z or -Z
  251.           The archive should be compressed as it is written, or
  252.           decompressed as it is read, using the compress(1) pro-
  253.           gram.  This option works on I/O devices and over the
  254.           network, as well as on disk files; data to or from such
  255.           devices is reblocked using a ``dd'' command to enforce
  256.           the specified (or default) block size.  The default
  257.           compression parameters are used; if you need to
  258.  
  259.  
  260.  
  261. Printed 5/26/91          5 November 1987                        4
  262.  
  263.  
  264.  
  265. TAR(1)              UNIX Programmer's Manual               TAR(1)
  266.  
  267.  
  268.  
  269.           override them, avoid the ``z'' option and compress it
  270.           yourself.
  271.  
  272. AUTHORS
  273.      Tar and compress were integrated for the MS-DOS release by
  274.      Diomidis Spinellis <dds@doc.ic.ac.uk>.
  275.      Tar was written by John Gilmore <gnu@toad.com>.
  276.      Compress was written and improved by Spencer W. Thomas, Jim
  277.      McKie, Steve Davies, Ken Turkowski, James A. Woods, Joe
  278.      Orost and Diomidis Spinellis.
  279.  
  280. SEE ALSO
  281.      shar(1), tar(5), compress(1), ar(1), arc(1), cpio(1),
  282.      dump(8), restore(8), restor(8), rsh(1), dd(1), find(1)
  283.  
  284. BUGS
  285.      The r, u, w, X, l, F, C, and digit options of Unix tar are
  286.      not supported.
  287.  
  288.      Multiple-tape (or floppy) archives should be supported, but
  289.      so far no clean way has been implemented.
  290.  
  291.      A bug in the Bourne Shell usually causes an extra newline to
  292.      be written to the standard error when using compressed or
  293.      remote archives.
  294.  
  295.      A bug in ``dd'' prevents turning off the ``x+y records
  296.      in/out'' messages on the standard error when ``dd'' is used
  297.      to reblock or transport an archive.
  298.  
  299.      On MS-DOS systems filename characters that are not supported
  300.      by most MS-DOS shells (;=+<>|,*?:[]\ ) are silently con-
  301.      verted into a circumflex (^) character.  Filanemes longer
  302.      than the ones supported by MS-DOS are silently truncated and
  303.      can thus overwrite files named with the same initial charac-
  304.      ters.
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327. Printed 5/26/91          5 November 1987                        5
  328.  
  329.  
  330.  
  331.