home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / info / tar.info-3 < prev    next >
Encoding:
GNU Info File  |  1996-10-12  |  48.4 KB  |  1,521 lines

  1. This is Info file tar.info, produced by Makeinfo-1.64 from the input
  2. file /ade-src/fsf/tar/doc/tar.texinfo.
  3.  
  4. START-INFO-DIR-ENTRY
  5. * tar: (tar).            Making tape (or disk) archives.
  6. END-INFO-DIR-ENTRY
  7.  
  8.    This file documents GNU `tar', a utility used to store, backup, and
  9. transport files.
  10.  
  11.    Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
  12.  
  13.    Permission is granted to make and distribute verbatim copies of this
  14. manual provided the copyright notice and this permission notice are
  15. preserved on all copies.
  16.  
  17.    Permission is granted to copy and distribute modified versions of
  18. this manual under the conditions for verbatim copying, provided that
  19. the entire resulting derived work is distributed under the terms of a
  20. permission notice identical to this one.
  21.  
  22.    Permission is granted to copy and distribute translations of this
  23. manual into another language, under the above conditions for modified
  24. versions, except that this permission notice may be stated in a
  25. translation approved by the Foundation.
  26.  
  27. 
  28. File: tar.info,  Node: Old Options,  Next: Mixing Styles,  Prev: Short Options,  Up: Option Styles
  29.  
  30. Old Option Style
  31. ----------------
  32.  
  33.      *(This message will disappear, once this node revised.)*
  34.  
  35.    Old options are single letters not preceeded by any dash at all, and
  36. appearing *only* in the position immediately following the `tar'
  37. keyword in the command, after some white space.  The letter of an old
  38. option is exactly the same letter as the corresponding short option.
  39. For example, the old option `t' is the same as the short option `-t',
  40. and consequently, the same as long option `--list' (`-t').
  41.  
  42.    As far as we know, all `tar' programs, GNU and non-GNU, support old
  43. options.  GNU `tar' supports them not only for historical reasons, but
  44. also because many people are used to them.
  45.  
  46.    All old options should be written as a single argument, without
  47. separating spaces, by lumping together all letters specifying these
  48. options.  This set of letters should be the first to appear on the
  49. command line, after the `tar' program name; old options cannot appear
  50. anywhere else.  Then, for any old option required an argument, the
  51. argument should follow on the command line.  Arguments to the options
  52. should appear in the same order as the letters to which they
  53. correspond.  The `tar' command synopsis might be rewritten:
  54.  
  55.      tar LETTER... [ARGUMENT]... [OPTION]... [NAME]...
  56.  
  57. when old options are being used.
  58.  
  59.    This command syntax is useful because it lets you type the single
  60. letter forms of the operation and options as a single argument to `tar',
  61. without writing preceding `-'s or inserting spaces between letters.
  62. `tar cv' or `tar -cv' are equivalent to `tar -c -v'.
  63.  
  64.    For compatibility with Unix `tar', the first argument can contain an
  65. option letter (or a cluster of option letters) *not* introduced by a
  66. dash; for example, `tar cv' specifies the option `-v' in addition to
  67. the command `-c'.  When options that need arguments are given together
  68. with the command, all the associated arguments follow, in the same
  69. order as the options.  Thus, the example above could also be written in
  70. the old style as follows:
  71.  
  72.      tar cvbf 20 /dev/rmt0
  73.  
  74. Here `20' is the argument of `-b' and `/dev/rmt0' is the argument of
  75. `-f'.
  76.  
  77.    On the other hand, this old style syntax makes it difficult to match
  78. option letters with their corresponding arguments, and is often
  79. confusing.  In the command `tar cvbf 20 /dev/rmt0', for example, `20'
  80. is the argument for `-b', `/dev/rmt0' is the argument for `-f', and
  81. `-v' does not have a corresponding argument.  Even using short options
  82. like in `tar -c -v -b 20 -f /dev/rmt0' is clearer, putting all
  83. arguments next to the option they pertain to.
  84.  
  85.    If you want to reorder the letters in the old option argument, be
  86. sure to appropriately reorder any corresponding argument.
  87.  
  88.    This old way of writing `tar' options can surprise even experienced
  89. users.  For example, the two commands:
  90.  
  91.      tar cfz archive.tar.gz file
  92.      tar -cfz archive.tar.gz file
  93.  
  94. are quite different.  The first example uses `archive.tar.gz' as the
  95. value for option `f' and recognizes the option `z'.  The second
  96. example, however, uses `z' as the value for option `f'--probably not
  97. what was intended.  (I find it quite inelegant that `getopt' batches
  98. the remaining `z' as the value for `f'.  I think that clarity dictates
  99. that clustering of option letters, when some require arguments, should
  100. be diagnosed and disallowed.  But compatibility with traditional
  101. systems dictates it.) This second example could be corrected in many
  102. ways, among which:
  103.  
  104.      tar -czf archive.tar.gz file
  105.      tar -cf archive.tar.gz -z file
  106.      tar cf archive.tar.gz -z file
  107.  
  108. 
  109. File: tar.info,  Node: Mixing Styles,  Prev: Old Options,  Up: Option Styles
  110.  
  111. Mixing Option Styles
  112. --------------------
  113.  
  114.    All three styles may be intermixed in a single `tar' command, as
  115. long as the rules for each style are fully respected.
  116.  
  117.    In GNU `tar' up to 1.11.6, using old style options was cutting out
  118. the possibility of using many options not having short forms.  Many
  119. users rightly expressed their frustration at fighting with the current
  120. `tar' option decoder, so I changed it.  However, GNU `tar' needs to be
  121. compatible with other `tar's, in the things that other `tar's can do.
  122. Short options should provide upward compatibility.  So, if the current
  123. option decoding raises incompatibilities, please let me know.
  124.  
  125.    Old style options and modern options may be mixed on a single call
  126. to the `tar' program.  However, old style options should be introduced
  127. in the first argument only; modern options may be given only after all
  128. arguments to old style options have been collected.  If this rule is
  129. not respected, a modern option might be falsely interpreted as the
  130. value of the argument to one of the old style options.
  131.  
  132.    For example, currently, all the following commands are wholly
  133. equivalent, and illustrate many combinations and orderings of option
  134. styles.
  135.  
  136.      tar --create --file=archive.tar
  137.      tar --create -f archive.tar
  138.      tar --create -farchive.tar
  139.      tar --file=archive.tar --create
  140.      tar --file=archive.tar -c
  141.      tar -c --file=archive.tar
  142.      tar -c -f archive.tar
  143.      tar -c -farchive.tar
  144.      tar -cf archive.tar
  145.      tar -cfarchive.tar
  146.      tar -f archive.tar --create
  147.      tar -f archive.tar -c
  148.      tar -farchive.tar --create
  149.      tar -farchive.tar -c
  150.      tar c --file=archive.tar
  151.      tar c -f archive.tar
  152.      tar c -farchive.tar
  153.      tar cf archive.tar
  154.      tar f archive.tar --create
  155.      tar f archive.tar -c
  156.      tar fc archive.tar
  157.  
  158.    On the other hand, the following commands are *not* equivalent to
  159. the previous set:
  160.  
  161.      tar -f -c archive.tar
  162.      tar -fc archive.tar
  163.      tar -fcarchive.tar
  164.      tar -farchive.tarc
  165.      tar cfarchive.tar
  166.  
  167. These last examples mean something completely different of what the user
  168. might have intended.  The first four specify that the `tar' archive
  169. would be a file named `-c', `c', `carchive.tar' or `archive.tarc',
  170. respectively.  The first two examples also specify a single non-option,
  171. NAME argument having value `archive.tar'.  The last example contains
  172. only old style option letters (repeating option `c' twice) and no
  173. argument value.
  174.  
  175. 
  176. File: tar.info,  Node: Options,  Prev: Option Styles,  Up: Invoking tar
  177.  
  178. All Available Options
  179. =====================
  180.  
  181.      *(This message will disappear, once this node revised.)*
  182.  
  183.    Options change the way `tar' performs an operation.
  184.  
  185. `--absolute-names'
  186. `--after-date=DATE'
  187.      Limit the operation to files changed after the given date.
  188.  
  189.      FIXME: xref File Exclusion
  190.      .
  191.  
  192. `--block-size=NUMBER'
  193.      Specify the blocking factor of an archive.
  194.      FIXME: xref Blocking Factor
  195.      .
  196.  
  197. `--compress'
  198.      Specify a compressed archive.
  199.      FIXME: xref Compressed Archives
  200.      .
  201.  
  202. `--compress-block.'
  203.      Create a whole block sized compressed archive.
  204.      FIXME: xref Compressed Archives
  205.      .
  206.  
  207. `--confirmation'
  208.      Solicit confirmation for each file.
  209.      FIXME: xref Interactive Operation
  210.  
  211.      FIXME: --selective should be a synonym.
  212.  
  213. `--dereference'
  214.      Treat a symbolic link as an alternate name for the file the link
  215.      points to.
  216.      FIXME: xref Symbolic Links
  217.      .
  218.  
  219. `--directory=`directory''
  220.      Change the working directory.
  221.      FIXME: xref Changing Working Directory
  222.      .
  223.  
  224. `--exclude=PATTERN'
  225.      Exclude files which match the regular expression PATTERN.
  226.  
  227.      FIXME: xref File Exclusion
  228.      .
  229.  
  230. `--exclude-from=`file''
  231.      Exclude files which match any of the regular expressions listed in
  232.      the file `file'.
  233.      FIXME: xref File Exclusion
  234.      .
  235.  
  236. `--file=ARCHIVE-NAME'
  237.      Name the archive.
  238.      FIXME: xref Archive Name
  239.      ).
  240.  
  241. `--files-from=`file''
  242.      Read file name arguments from a file on the file system.
  243.  
  244.      FIXME: xref File Name Lists
  245.      .
  246.  
  247. `--ignore-umask'
  248.      Set modes of extracted files to those recorded in the archive.
  249.  
  250.      FIXME: xref File Writing Options
  251.      .
  252.  
  253. `--ignore-zeros'
  254.      Ignore end-of-archive entries.
  255.      FIXME: xref Archive Reading Options
  256.      .
  257.      FIXME: this should be changed to --ignore-end
  258.  
  259. `--tape-length=N  (-L)'
  260.      FIXME: alternate way of doing multi archive, will go to that length and
  261.      FIXME: prompts for new tape, automatically turns on multi-volume.  this
  262.      FIXME: needs to be written into main body as well
  263.  
  264. `--info-script=PROGRAM-FILE'
  265.      Create a multi-volume archive via a script.
  266.      FIXME: xref Multi-Volume Archives
  267.      .
  268.  
  269. `--interactive'
  270.      Ask for confirmation before performing any operation on a file or
  271.      archive member.
  272.  
  273. `--keep-old-files'
  274.      Prevent overwriting during extraction.
  275.      FIXME: xref File Writing Options
  276.      .
  277.  
  278. `--label=ARCHIVE-LABEL'
  279.      Include an archive-label in the archive being created.
  280.      FIXME: xref Archive
  281.      Label
  282.      .
  283.  
  284. `--modification-time'
  285.      Set the modification time of extracted files to the time they were
  286.      extracted.
  287.      FIXME: xref File Writing Options
  288.      .
  289.  
  290. `--multi-volume'
  291.      Specify a multi-volume archive.
  292.      FIXME: xref Multi-Volume Archives
  293.      .
  294.  
  295. `--newer=DATE'
  296.      Limit the operation to files changed after the given date.
  297.  
  298.      FIXME: xref File Exclusion
  299.      .
  300.  
  301. `--newer-mtime=DATE'
  302.      Limit the operation to files modified after the given date.
  303.      FIXME: xref File
  304.      Exclusion
  305.      .
  306.  
  307. `--old'
  308.      Create an old format archive.
  309.      FIXME: xref Old Style File Information
  310.      .
  311.      FIXME: did we agree this should go away as a synonym?
  312.  
  313. `--old-archive'
  314.      Create an old format archive.
  315.      FIXME: xref Old Style File Information
  316.      .
  317.  
  318. `--one-file-system'
  319.      Prevent `tar' from crossing file system boundaries when archiving.
  320.      FIXME: xref File Exclusion
  321.      .
  322.  
  323. `--portability'
  324.      Create an old format archive.
  325.      FIXME: xref Old Style File Information
  326.      .
  327.      FIXME: was portability, may still need to be changed
  328.  
  329. `--preserve-order'
  330.      Help process large lists of file names on machines with small
  331.      amounts of memory.
  332.      FIXME: xref Archive Reading Options
  333.      .
  334.  
  335. `--preserve-permission'
  336.      Set modes of extracted files to those recorded in the archive.
  337.  
  338.      FIXME: xref File Writing Options
  339.      .
  340.  
  341. `--read-full-blocks'
  342.      Read an archive with a smaller than specified block size or which
  343.      contains incomplete blocks.
  344.      FIXME: xref Archive Reading Options
  345.      ).
  346.      FIXME: should be --partial-blocks (!)
  347.  
  348. `--record-number'
  349.      Print the record number where a message is generated.
  350.  
  351.      FIXME: xref Additional Information
  352.      .
  353.  
  354. `--same-order'
  355.      Help process large lists of file names on machines with small
  356.      amounts of memory.
  357.      FIXME: xref Archive Reading Options
  358.      .
  359.  
  360. `--same-permission'
  361.      Set the modes of extracted files to those recorded in the archive.
  362.  
  363.      FIXME: xref File Writing Options
  364.      .
  365.  
  366. `--sparse'
  367.      Archive sparse files sparsely.
  368.      FIXME: xref Sparse Files
  369.      .
  370.  
  371. `--starting-file=FILE NAME'
  372.      Begin reading in the middle of an archive.
  373.      FIXME: xref Scarce Disk Space
  374.      .
  375.  
  376. `--to-stdout'
  377.      Write files to the standard output.
  378.      FIXME: xref File Writing Options
  379.      .
  380.  
  381. `--uncompress'
  382.      Specifdo  a compressed archive.
  383.      FIXME: xref Compressed Archives
  384.      .
  385.  
  386. `-V ARCHIVE-LABEL'
  387.      Include an archive-label in the archive being created.
  388.      FIXME: xref Archive
  389.      Label
  390.      .
  391.      FIXME: was --volume
  392.  
  393. `--verbose'
  394.      Print the names of files or archive members as they are being
  395.      operated on.
  396.      FIXME: xref Additional Information
  397.      .
  398.  
  399. `--verify'
  400.      Check for discrepancies in the archive immediately after it is
  401.      written.
  402.      FIXME: xref Write Verification
  403.      .
  404.  
  405. `-B'
  406.      Read an archive with a smaller than specified block size or which
  407.      contains incomplete blocks.
  408.      FIXME: xref Archive Reading Options
  409.      ).
  410.  
  411. `-K FILE NAME'
  412.      Begin reading in the middle of an archive.
  413.      FIXME: xref Scarce Disk Space
  414.      .
  415.  
  416. `-M'
  417.      Specify a multi-volume archive.
  418.      FIXME: xref Multi-Volume Archives
  419.      .
  420.  
  421. `-N DATE'
  422.      Limit operation to files changed after the given date.
  423.      FIXME: xref File Exclusion
  424.      .
  425.  
  426. `-O'
  427.      Write files to the standard output.
  428.      FIXME: xref File Writing Options
  429.      .
  430.  
  431.      FIXME: - P is absolute names, add when resolved.
  432.  
  433. `-R'
  434.      Print the record number where a message is generated.
  435.  
  436.      FIXME: xref Additional Information
  437.      .
  438.  
  439. `-S'
  440.      Archive sparse files sparsely.
  441.      FIXME: xref Sparse Files
  442.      .
  443.  
  444. `-T FILE'
  445.      Read file name arguments from a file on the file system.
  446.  
  447.      FIXME: xref File Name Lists
  448.      .
  449.  
  450. `-W'
  451.      Check for discrepancies in the archive immediately after it is
  452.      written.
  453.      FIXME: xref Write Verification
  454.      .
  455.  
  456. `-Z'
  457.      Specify a compressed archive.
  458.      FIXME: xref Compressed Archives
  459.      .
  460.  
  461. `-b NUMBER'
  462.      Specify the blocking factor of an archive.
  463.      FIXME: xref Blocking Factor
  464.      .
  465.  
  466. `-f ARCHIVE-NAME'
  467.      Name the archive.
  468.      FIXME: xref Archive Name
  469.      ).
  470.  
  471. `-h'
  472.      Treat a symbolic link as an alternate name for the file the link
  473.      points to.
  474.      FIXME: xref Symbolic Links
  475.      .
  476.  
  477. `-i'
  478.      Ignore end-of-archive entries.
  479.      FIXME: xref Archive Reading Options
  480.      .
  481.  
  482. `-k'
  483.      Prevent overwriting during extraction.
  484.      FIXME: xref File Writing Options
  485.      .
  486.  
  487. `-l'
  488.      Prevent `tar' from crossing file system boundaries when archiving.
  489.      FIXME: xref File Exclusion
  490.      .
  491.  
  492. `-m'
  493.      Set the modification time of extracted files to the time they were
  494.      extracted.
  495.      FIXME: xref File Writing Options
  496.      .
  497.  
  498. `-o'
  499.      Create an old format archive.
  500.      FIXME: xref Old Style File Information
  501.      .
  502.  
  503. `-p'
  504.      Set the modes of extracted files to those recorded in the archive.
  505.  
  506.      FIXME: xref File Writing Options
  507.      .
  508.  
  509. `-s'
  510.      Help process large lists of file names on machines with small
  511.      amounts of memory.
  512.      FIXME: xref Archive Reading Options
  513.      .
  514.  
  515. `-v'
  516.      Print the names of files or archive members they are being operated
  517.      on.
  518.      FIXME: xref Additional Information
  519.      .
  520.  
  521. `-w'
  522.      FIXME: see --interactive.
  523.  
  524. `-z'
  525.      Specify a compressed archive.
  526.      FIXME: xref Compressed Archives
  527.      .
  528.  
  529. `-z -z'
  530.      Create a whole block sized compressed archive.
  531.      FIXME: xref Compressed Archives
  532.      .
  533.      FIXME: I would rather this were -Z.  it is the only double letter short
  534.      FIXME: form.
  535.  
  536. `-C `directory''
  537.      Change the working directory.
  538.      FIXME: xref Changing Working Directory
  539.      .
  540.  
  541. `-F PROGRAM-FILE'
  542.      Create a multi-volume archive via a script.
  543.      FIXME: xref Multi-Volume Archives
  544.      .
  545.  
  546. `-X `file''
  547.      Exclude files which match any of the regular expressions listed in
  548.      the file `file'.
  549.      FIXME: xref File Exclusion
  550.      .
  551.  
  552. * Menu:
  553.  
  554. * Device Options::
  555. * Blocking Options::
  556. * Classification Options::
  557.  
  558. 
  559. File: tar.info,  Node: Device Options,  Next: Blocking Options,  Prev: Options,  Up: Options
  560.  
  561. Device selection and switching
  562. ------------------------------
  563.  
  564.      *(This message will disappear, once this node revised.)*
  565.  
  566. `-f [HOSTNAME:]FILE'
  567. `--file=[HOSTNAME:]FILE'
  568.      Use archive file or device FILE on HOSTNAME.
  569.      FIXME: xref Device
  570.      .
  571.  
  572. `--force-local'
  573.      Archive file is local even if it contains a colon.
  574.      FIXME: xref Device
  575.      .
  576.  
  577. `--rsh-command=COMMAND'
  578.      Use remote COMMAND instead of `rsh'.
  579.      FIXME: xref Device
  580.      .
  581.  
  582. `-[0-7][lmh]'
  583.      Specify drive and density.
  584.      FIXME: xref Device
  585.      .
  586.  
  587. `-M'
  588. `--multi-volume'
  589.      Create/list/extract multi-volume archive.
  590.      FIXME: xref Multi
  591.      .
  592.  
  593. `-L NUM'
  594. `--tape-length=NUM'
  595.      Change tape after writing NUM x 1024 bytes.
  596.      FIXME: xref Multi
  597.      .
  598.  
  599. `-F FILE'
  600. `--info-script=FILE'
  601. `--new-volume-script=FILE'
  602.      Execute `file' at end of each tape.  This implies `--multi-volume'
  603.      (`-M')).
  604.      FIXME: xref Multi
  605.      .
  606.  
  607. 
  608. File: tar.info,  Node: Blocking Options,  Next: Classification Options,  Prev: Device Options,  Up: Options
  609.  
  610. Device blocking
  611. ---------------
  612.  
  613.      *(This message will disappear, once this node revised.)*
  614.  
  615. `-b BLOCKS'
  616. `--block-size=BLOCKS'
  617.      Set block size to BLOCKS * 512 bytes.
  618.      FIXME: xref Blocking
  619.      .
  620.  
  621. `--block-compress'
  622.      Block the output of compression for tapes.
  623.      FIXME: xref Blocking
  624.      .
  625.  
  626. `-i'
  627. `--ignore-zeros'
  628.      Ignore blocks of zeros in archive (means EOF).
  629.      FIXME: xref Blocking
  630.      .
  631.  
  632. `-B'
  633. `--read-full-blocks'
  634.      Reblock as we read (for reading 4.2BSD pipes).
  635.      FIXME: xref Blocking
  636.      .
  637.  
  638. 
  639. File: tar.info,  Node: Classification Options,  Prev: Blocking Options,  Up: Options
  640.  
  641. Old classification of options
  642. -----------------------------
  643.  
  644.      *(This message will disappear, once this node revised.)*
  645.  
  646.    The information here is to be revised and merged into the remainder
  647. of this document, possibly altering its structure.
  648.  
  649.    Options could be regrouped in three categories:
  650.  
  651. General Options
  652.      Options that are always meaningful.
  653.  
  654. Creation Options
  655.      Options for creating or updating an archive.
  656.  
  657. Extraction Options
  658.      Options for listing or extracting files.
  659.  
  660.    Here are the options that are always meaningful.
  661.  
  662. `-B NUMBER', `--block-size NUMBER'
  663. `-f FILENAME', `--file FILENAME'
  664. `-C DIR', `--directory DIR'
  665. `-M', `--multi-volume'
  666. `-N DATE', `--after-date DATE'
  667. `-R', `--record-number' (`-R')
  668. `-T FILENAME', `--files-from FILENAME'
  669. `-v', `--verbose' (`-v')
  670. `-w', `--interactive'
  671. `-X FILE', `--exclude FILE'
  672. `-z', `-Z', `--compress', `--uncompress'
  673.    Here are the options for creating or updating an archive.  These
  674. options are used to control which files `tar' puts in an archive, or to
  675. control the format the archive is written in
  676. FIXME: ref Format
  677.    .  Except as noted elsewhere, these options are useful with the
  678. `--create' (`-c'), `--append' (`-r'), `--update' (`-u'),
  679. `--concatenate' (`-A'), and `--delete' commands.  Also note that the
  680. {No Value For "read-full-block"} option
  681. FIXME: (pxref Extraction Options),
  682.    is also useful with the `--append' (`-r'), `--update' (`-u'),
  683. `--concatenate' (`-A'), and `--delete' commands.
  684.  
  685. `-G', `--incremental'
  686. `-h', `--dereference' (`-h')
  687. `-l', `--one-file-system'
  688. `-o', `--old-archive' (`-o')
  689. `--old', `--portability'
  690. `-S', `--sparse'
  691. `-V NAME', `--volume NAME'
  692. `-W', `--verify'
  693.    Here are the options for listing or extracting files.  The options
  694. in this section are meaningful with the `--extract' (`-x') command.
  695. Unless otherwise stated, they are also meaningful with the `--list'
  696. (`-t') command.
  697.  
  698. `-B', `--read-full-blocks'
  699. `-G', `--incremental'
  700. `-i', `--ignore-zeros'
  701. `-k', `--keep-old-files'
  702. `-K FILENAME', `--starting-file FILENAME'
  703. `-m', `--modification-time'
  704. `-O', `--to-stdout'
  705. `-p', `--same-permissions', `--preserve-permissions'
  706. `-P', `--absolute-names' (`-P')
  707. `-s', `--same-order', `--preserve-order'
  708. `--preserve'
  709. 
  710. File: tar.info,  Node: Basic tar Operations,  Next: Specifying Names to tar,  Prev: Invoking tar,  Up: Top
  711.  
  712. Basic `tar' Operations
  713. **********************
  714.  
  715.      *(This message will disappear, once this node revised.)*
  716.  
  717.    This chapter describes the basic operations supported by the `tar'
  718. program.  A given invocation of `tar' will do exactly one of these
  719. operations.
  720.  
  721.    An archive member in normally extracted into a file with the same
  722. name as the archive member.  However, you can use the `--to-stdout'
  723. (`-O') to cause `tar' to write extracted archive members to standard
  724. output.  If you extract multiple members, they appear on standard output
  725. concatenated, in the order they are found in the archive.
  726.  
  727.    The `--create' (`-c') operation writes a new archive, and the
  728. `--extract' (`-x') operation reads files from an archive and writes them
  729. into the file system.  You can use other `tar' operations to write new
  730. information into an existing archive (adding files to it, adding
  731. another archive to it, or deleting files from it), and you can read a
  732. list of the files in an archive without extracting it using the
  733. `--list' (`-t') operation.
  734.  
  735.    The primary argument to `tar' is the "operation", which specifies
  736. what `tar' does.  `tar' can be used to:
  737.  
  738.    * Add files to an existing archive--`--append' (`-r').
  739.  
  740.    * Compare files in an archive with files in the file
  741.      system--`--compare' (`-d') or `--diff'.
  742.  
  743.    * Add archives to another archive--`--concatenate' (`-A').
  744.  
  745.    * Create an archive--`--create' (`-c').
  746.  
  747.    * Delete files from an archive--`--delete'.
  748.  
  749.    * Extract files from an archive--`--extract' (`-x') or `--get'.
  750.  
  751.    * List the files in an archive--`--list' (`-t').
  752.  
  753.    * Update an archive by appending newer versions of already stored
  754.      files--`--update' (`-u').
  755.  
  756. FIXME: xref Reading and Writing
  757.    , for more information about these operations.
  758.  
  759.    "Option" arguments to `tar' change details of the operation, such as
  760. archive format, archive name, or level of user interaction. You can
  761. specify more than one option.  All options are optional.
  762.  
  763.    "File Name" arguments specify which files (including directory
  764. files) to archive, extract, delete or otherwise operate on.
  765.  
  766.    If you don't use any file name arguments, `--append' (`-r'),
  767. `--update' (`-u') and `--delete' will do nothing.  The other operations
  768. of `tar' will act on defaults.
  769.  
  770.    When you use a file name argument to specify a directory file, `tar'
  771. acts on all the files in that directory, including sub-directories.
  772.  
  773.    You must give exactly one option from the following list to `tar'.
  774. This option specifies the basic operation for `tar' to perform.
  775.  
  776. `--create'
  777. `-c'
  778.      Create a new archive
  779.  
  780. `--catenate'
  781. `--concatenate'
  782. `-A'
  783.      Add the contents of one or more archives to another archive
  784.  
  785. `--append'
  786. `-a'
  787.      Add files to an existing archive
  788.  
  789. `--list'
  790. `-t'
  791.      List the members in an archive
  792.  
  793. `--delete'
  794.      Delete members from an archive
  795.  
  796. `--extract'
  797. `--get'
  798. `-x'
  799.      Extract members from an archive
  800.  
  801. `--compare'
  802. `--diff'
  803. `-d'
  804.      Compare members in an archive with files in the file system
  805.  
  806. `--update'
  807. `-u'
  808.      Update an archive by appending newer versions of already stored
  809.      files
  810.  
  811.    The remaining options to `tar' change details of the operation, such
  812. as archive format, archive name, or level of user interaction.  You can
  813. specify more than one option.
  814.  
  815.    The remaining arguments are interpreted either as file names or as
  816. member names, depending on the basic operation `tar' is performing.
  817. For `--append' (`-r') and `--create' (`-c') these arguments specify the
  818. names of files (which must already exist) to place in the archive.  For
  819. the remaining operation types, the additional arguments specify archive
  820. members to compare, delete, extract, list, or update.  When naming
  821. archive members, you must give the exact name of the member in the
  822. archive, as it is printed by `--list' (`-t').  When naming files, the
  823. normal file name rules apply.
  824.  
  825.    If you don't use any additional arguments, `--append' (`-r'),
  826. `--concatenate' (`-A'), and `--delete' will do nothing.  Naturally,
  827. `--create' (`-c') will make an empty archive if given no files to add.
  828. The other operations of `tar' (`--list' (`-t'), `--extract' (`-x'),
  829. `--compare' (`-d'), and `--update' (`-u')) will act on the entire
  830. contents of the archive.
  831.  
  832.    If you give the name of a directory as either a file name or a member
  833. name, then `tar' acts recursively on all the files and directories
  834. beneath that directory.  For example, the name `/' identifies all the
  835. files in the filesystem to `tar'.
  836.  
  837.    The operation argument to `tar' specifies which action you want to
  838. take.
  839.  
  840. `-A'
  841.      Adds copies of an archive or archives to the end of another
  842.      archive.
  843.  
  844. `-c'
  845.      Creates a new archive.
  846.  
  847. `-d'
  848.      Compares files in the archive with their counterparts in the file
  849.      system, and reports differences in file size, mode, owner,
  850.      modification date and contents.
  851.  
  852. `-r'
  853.      Adds files to the end of the archive.
  854.  
  855. `-t'
  856.      Prints a list of the contents of the archive.
  857.  
  858. `-x'
  859.      Reads files from the archive and writes them into the active file
  860.      system.
  861.  
  862. `-u'
  863.      Adds files to the end of the archive, but only if they are newer
  864.      than their counterparts already in the archive, or if they do not
  865.      already exist in the archive.
  866.  
  867. `--catenate'
  868.      Adds copies of an archive or archives to the end of another
  869.      archive.
  870.  
  871. `--append'
  872.      Adds files to the end of the archive.
  873.  
  874. `--append'
  875.      Adds files to the end of the archive.
  876.  
  877. `--catenate'
  878.      Adds copies of an archive or archives to the end of another
  879.      archive.
  880.  
  881. `--compare'
  882.      Compares files in the archive with their counterparts in the file
  883.      system, and reports differences in file size, mode, owner,
  884.      modification date and contents.
  885.  
  886. `--concatenate'
  887.      Adds copies of an archive or archives to the end of another
  888.      archive.
  889.  
  890. `--create'
  891.      Creates a new archive.
  892.  
  893. `--delete'
  894.      Deletes files from the archive.  All versions of the files are
  895.      deleted.
  896.  
  897. `--diff'
  898.      Compares files in the archive with their counterparts in the file
  899.      system, and reports differences in file size, mode, owner,
  900.      modification date and contents.
  901.  
  902. `--extract'
  903.      Reads files from the archive and writes them into the active file
  904.      system.
  905.  
  906. `--get'
  907.      Reads files from the archive and writes them into the active file
  908.      system.
  909.  
  910. `--list'
  911.      Prints a list of the contents of the archive.
  912.  
  913. `--update'
  914.      Adds files to the end of the archive, but only if they are newer
  915.      than their counterparts already in the archive, or if they do not
  916.      already exist in the archive.
  917.  
  918. `--version'
  919.      Prints the version number of the `tar' program to the standard
  920.      error.
  921.  
  922.    The program `tar' can create an archive, extract files from an
  923. archive, modify an archive, or list an archive's contents.  Each time
  924. you run `tar', you must give a "command" to specify which one of these
  925. things you want to do.
  926.  
  927.    The command must always be in the first argument to `tar'.  This
  928. argument can also contain options (
  929. FIXME: pxref Invoking tar
  930.    ).  For compatibility with Unix `tar', the first argument is always
  931. treated as containing command and option letters even if it doesn't
  932. start with `-'.  Thus, `tar c' is equivalent to `tar -c': both of them
  933. specify the `--create' (`-c') command to create an archive.
  934.  
  935.    In addition, a set of long-named options are provided which can be
  936. used instead of or intermixed with the single-letter flags.  The
  937. long-named options are meant to be easy to remember and logical, while
  938. the single letter flags may not always be.  Long-named options begin
  939. with `--'.
  940.  
  941.    Arguments after the first are either options, if they start with `-'
  942. or `--', or files to operate on.
  943.  
  944.    The file names that you give as arguments are the files that `tar'
  945. will act on--for example, they are the files to put in the archive, or
  946. the files to extract from it.  If you don't give any file name
  947. arguments, the default depends on which command you used.  Some commands
  948. use all relevant files; some commands have no default and will report an
  949. error if you don't specify files.
  950.  
  951.    If a file name argument actually names a directory, then that
  952. directory and all files and subdirectories (recursively) in it are used.
  953.  
  954.    Here is a list of the `tar' commands:
  955.  
  956. `-c'
  957. `--create'
  958.      Create a new archive.
  959.  
  960.      This command tells `tar' to create a new archive that contains the
  961.      file(s) specified on the command line.  If you don't specify
  962.      files, all the files in the current directory are used.
  963.  
  964.      If the archive file already exists, it is overwritten; the old
  965.      contents are lost.
  966.  
  967. `-x'
  968. `--extract'
  969. `--get'
  970.      Extract files from an archive.
  971.  
  972.      This command causes `tar' to extract the specified files from the
  973.      archive.  If no file names are given, all the files in the archive
  974.      will be extracted.
  975.  
  976. `-t'
  977. `--list'
  978.      List the contents of an archive.
  979.  
  980.      This command causes `tar' to display a list of the files in the
  981.      archive.  If you specify file names, only the files that you
  982.      specify will be mentioned (but each of them is mentioned only if it
  983.      appears in the archive).
  984.  
  985. `-d'
  986. `--diff'
  987. `--compare'
  988.      Find differences between an archive and the corresponding online
  989.      files.
  990.  
  991.      This command causes `tar' to compare the archive with the files in
  992.      the file system.  It will report differences in file size, mode,
  993.      owner, and contents.  If a file exists in the archive, but not in
  994.      the file system, `tar' will report this.
  995.  
  996.      If you specify file names, those files are compared with the tape
  997.      and they must all exist in the archive.  If you don't specify
  998.      files, all the files in the archive are compared.
  999.  
  1000. `-r'
  1001. `--append'
  1002.      Append files to the end of an archive.
  1003.  
  1004.      This command causes `tar' to add the specified file(s) to the end
  1005.      of the archive.  This assumes that the archive file already exists
  1006.      and is in the proper format (which probably means it was created
  1007.      previously with the `tar' program).  If the archive is not in a
  1008.      format that `tar' understands, the results will be unpredictable.
  1009.  
  1010.      You must specify the files to be used; there is no default.
  1011.  
  1012. `-u'
  1013. `--update'
  1014.      Only append files newer than the version in an archive.
  1015.  
  1016.      This command causes `tar' to add the specified files to the end of
  1017.      the archive, like `--append' (`-r'), but only when a file doesn't
  1018.      already exist in the archive or is newer than the version in the
  1019.      archive (the last-modification time is compared).  Adding files to
  1020.      the end of an archive can be very slow.
  1021.  
  1022.      You must specify the files to be used; there is no default.
  1023.  
  1024. `-A'
  1025. `--catenate'
  1026. `--concatenate'
  1027.      Append existing archives to another archive.
  1028.  
  1029.      This command is used for concatenating several archive files into
  1030.      one big archive file.  The files to operate on should all be
  1031.      archive files.  They are all appended to the end of the archive
  1032.      file which `tar' works on.  (The other files are not changed).
  1033.  
  1034.      You might be tempted to use `cat' for this, but it won't ordinarily
  1035.      work.  A `tar' archive contains data which indicates the end of the
  1036.      archive, so appended material is ignored.  This command works
  1037.      because it removes the end-of-archive markers from the middle of
  1038.      the result.
  1039.  
  1040. `--delete'
  1041.      Delete from the archive (not on tapes!).
  1042.  
  1043.      This command causes `tar' to delete the specified files from the
  1044.      archive.  This command is extremely slow.  Warning: Use of this
  1045.      command on archives stored on magnetic tape may result in a
  1046.      scrambled archive.  There is no safe way (except for completely
  1047.      re-writing the archive) to delete files from a magnetic tape.
  1048.  
  1049.    The program `tar' can create an archive, extract files from an
  1050. archive, modify an archive, or list an archive's contents.  Each time
  1051. you run `tar', you must give a "command" to specify which one of these
  1052. things you want to do.
  1053.  
  1054.    The command must always be in the first argument to `tar'.  This
  1055. argument can also contain options (
  1056. FIXME: pxref Invoking tar
  1057.    ).  For compatibility with Unix `tar', the first argument is always
  1058. treated as containing command and option letters even if it doesn't
  1059. start with `-'.  Thus, `tar c' is equivalent to `tar -c': both of them
  1060. specify the `--create' (`-c') command to create an archive.
  1061.  
  1062.    In addition, a set of long-named options are provided which can be
  1063. used instead of or intermixed with the single-letter flags.  The
  1064. long-named options are meant to be easy to remember and logical, while
  1065. the single letter flags may not always be.  Long-named options begin
  1066. with `--'.
  1067.  
  1068.    Arguments after the first are either options, if they start with `-'
  1069. or `--', or files to operate on.
  1070.  
  1071.    The file names that you give as arguments are the files that `tar'
  1072. will act on--for example, they are the files to put in the archive, or
  1073. the files to extract from it.  If you don't give any file name
  1074. arguments, the default depends on which command you used.  Some commands
  1075. use all relevant files; some commands have no default and will report an
  1076. error if you don't specify files.
  1077.  
  1078.    If a file name argument actually names a directory, then that
  1079. directory and all files and subdirectories (recursively) in it are used.
  1080.  
  1081.    Modifying Archives
  1082.  
  1083.    Once an archive is created, you can add new archive members to it,
  1084. add the contents of another archive, add newer versions of members
  1085. already stored, or delete archive members already stored.
  1086.  
  1087.    To find out what files are already stored in an archive, use `tar
  1088. --list --file=ARCHIVE-NAME'.
  1089. FIXME: xref Listing Contents
  1090.    .
  1091.  
  1092. * Menu:
  1093.  
  1094. * Creating a New Archive::
  1095. * Adding to an Existing Archive::
  1096. * Updating an Archive::
  1097. * Combining Archives::
  1098. * Removing Archive Members::
  1099. * Listing Archive Members::
  1100. * Extracting Archive Members::
  1101. * Comparing Archives Members with Files::
  1102. * Matching Format Parameters::
  1103.  
  1104. 
  1105. File: tar.info,  Node: Creating a New Archive,  Next: Adding to an Existing Archive,  Prev: Basic tar Operations,  Up: Basic tar Operations
  1106.  
  1107. Creating a New Archive
  1108. ======================
  1109.  
  1110.      *(This message will disappear, once this node revised.)*
  1111.  
  1112.    The `--create' (`-c') option causes `tar' to create a new archive.
  1113. The files to be archived are then named on the command line.  Each file
  1114. will be added to the archive with a member name exactly the same as the
  1115. name given on the command line.  (When you give an absolute file name
  1116. `tar' actually modifies it slightly,
  1117. FIXME: ref Absolute
  1118. Names
  1119.    .)  If you list no files to be archived, then an empty archive is
  1120. created.
  1121.  
  1122.    If there are two many files to conveniently list on the command line,
  1123. you can list the names in a file, and `tar' will read that file.
  1124.  
  1125. FIXME: xref Reading Names from a File
  1126.    .
  1127.  
  1128.    If you name a directory, then `tar' will archive not only the
  1129. directory, but all its contents, recursively.  For example, if you name
  1130. `/', then `tar' will archive the entire filesystem.
  1131.  
  1132.    Do not use the option to add files to an existing archive; it will
  1133. delete the archive and write a new one.  Use `--append' (`-r') instead.
  1134. (
  1135. FIXME: xref Adding to an Existing Archive
  1136.    .)
  1137.  
  1138.    There are various ways of causing `tar' to skip over some files, and
  1139. not archive them.
  1140. FIXME: xref Specifying Names to tar
  1141.    .
  1142.  
  1143. FIXME: operations should probably have examples, not tables.
  1144.  
  1145.    To create an archive, use `--create' (`-c').  To name the archive,
  1146. use `--file=ARCHIVE-NAME' in conjunction with the `--create' (`-c')
  1147. operation (
  1148. FIXME: pxref Archive Name
  1149.    ).  If you do not name the archive, `tar' uses the value of the
  1150. environment variable `TAPE' as the file name for the archive, or, if
  1151. that is not available, `tar' uses a default archive name, usually that
  1152. for tape unit zero.
  1153. FIXME: xref Archive Name
  1154.    , for more information about specifying an archive name.
  1155.  
  1156.    The following example creates an archive named `stooges', containing
  1157. the files `larry', `moe' and `curley':
  1158.  
  1159.      tar --create --file=stooges larry moe curley
  1160.  
  1161.    If you specify a directory name as a file name argument, `tar' will
  1162. archive all the files in that directory.  The following example creates
  1163. an archive named `hail/hail/fredonia', containing the contents of the
  1164. directory `marx':
  1165.  
  1166.      tar --create --file=hail/hail/fredonia marx
  1167.  
  1168.    If you don't specify files to put in the archive, `tar' archives all
  1169. the files in the working directory.  The following example creates an
  1170. archive named `home' containing all the files in the working directory:
  1171.  
  1172.      tar --create --file=home
  1173.  
  1174. FIXME: xref File Name Lists
  1175.    , for other ways to specify files to archive.
  1176.  
  1177.    Note: In the example above, an archive containing all the files in
  1178. the working directory is being written to the working directory.  GNU
  1179. `tar' stores files in the working directory in an archive which is
  1180. itself in the working directory without falling into an infinite loop.
  1181. Other versions of `tar' may fall into this trap.
  1182.  
  1183. 
  1184. File: tar.info,  Node: Adding to an Existing Archive,  Next: Updating an Archive,  Prev: Creating a New Archive,  Up: Basic tar Operations
  1185.  
  1186. Adding to an Existing Archive
  1187. =============================
  1188.  
  1189.      *(This message will disappear, once this node revised.)*
  1190.  
  1191.    The `--append' (`-r') option will case `tar' to add new files to an
  1192. existing archive.  It interprets file names and member names in exactly
  1193. the same manner as `--create' (`-c').  Nothing happens if you don't
  1194. list any names.
  1195.  
  1196.    This option never deletes members.  If a new member is added under
  1197. the same name as an existing member, then both will be in the archive,
  1198. with the new member after the old one.  For information on how this
  1199. affects reading the archive,
  1200. FIXME: ref Multiple Members with the Same Name
  1201.    .
  1202.  
  1203.    This operation cannot be performed on some tape drives,
  1204. unfortunately, due to deficiencies in the formats thoes tape drives use.
  1205.  
  1206.    To add files to an archive, use `--append' (`-r').  The archive to
  1207. be added to must already exist and be in proper archive format (which
  1208. normally means it was created previously using `tar').  If the archive
  1209. was created with a different block size than now specified, `tar' will
  1210. report an error (
  1211. FIXME: pxref Blocking Factor
  1212.    ).  If the archive is not a valid `tar' archive, the results will be
  1213. unpredictable.  You cannot add files to a compressed archive, however
  1214. you can add files to the last volume of a multi-volume archive.
  1215.  
  1216. FIXME: xref Matching Format Parameters
  1217.    .
  1218.  
  1219.    The following example adds the file `shemp' to the archive `stooges'
  1220. created above:
  1221.  
  1222.      tar --append --file=stooges shemp
  1223.  
  1224.    You must specify the files to be added; there is no default.
  1225.  
  1226.    `--update' (`-u') acts like `--append' (`-r'), but does not add
  1227. files to the archive if there is already a file entry with that name in
  1228. the archive that has the same modification time.
  1229.  
  1230.    Both `--update' (`-u') and `--append' (`-r') work by adding to the
  1231. end of the archive.  When you extract a file from the archive, only the
  1232. version stored last will wind up in the file system.  Because
  1233. `--extract' (`-x') extracts files from an archive in sequence, and
  1234. overwrites files with the same name in the file system, if a file name
  1235. appears more than once in an archive the last version of the file will
  1236. overwrite the previous versions which have just been extracted.  You
  1237. should avoid storing older versions of a file later in the archive.
  1238.  
  1239.    Note:  `--update' (`-u') is not suitable for performing backups,
  1240. because it doesn't change directory content entries, and because it
  1241. lengthens the archive every time it is used.
  1242. FIXME: xref to scripted backup, listed incremental, for info on backups.
  1243.  
  1244. 
  1245. File: tar.info,  Node: Updating an Archive,  Next: Combining Archives,  Prev: Adding to an Existing Archive,  Up: Basic tar Operations
  1246.  
  1247. Updating an Archive
  1248. ===================
  1249.  
  1250.      *(This message will disappear, once this node revised.)*
  1251.  
  1252.    The `--update' (`-u') option updates a `tar' archive by comparing
  1253. the date of the specified archive members against the date of the file
  1254. with the same name.  If the file has been modified more recently than
  1255. the archive member, then the archive member is deleted (as with
  1256. `--delete') and then the file is added to the archive (as with
  1257. `--append' (`-r')).  On media where the `--delete' option cannot be
  1258. performed (such as magnetic tapes), the `--update' (`-u') option
  1259. similarly fails.
  1260.  
  1261.    If no archive members are named (either on the command line or via
  1262. `--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES')), then the entire
  1263. archive is processed in this manner.
  1264.  
  1265. 
  1266. File: tar.info,  Node: Combining Archives,  Next: Removing Archive Members,  Prev: Updating an Archive,  Up: Basic tar Operations
  1267.  
  1268. Combining Archives
  1269. ==================
  1270.  
  1271.      *(This message will disappear, once this node revised.)*
  1272.  
  1273.    The `--concatenate' (`-A') or {No Value For "catenate"} option
  1274. causes `tar' to add the contents of several archives to an existing
  1275. archive.
  1276.  
  1277.    Name the archives to be catenated on the command line.  (Nothing
  1278. happens if you don't list any.)  The members, and their member names,
  1279. will be copied verbatim from those archives.  If this causes multiple
  1280. members to have the same name, it does not delete either; all the
  1281. members with the same name coexist.  For information on how this
  1282. affects reading the archive,
  1283. FIXME: ref Multiple Members with the Same Name
  1284.    .
  1285.  
  1286.    You must use this option to concatenate archives.  If you just
  1287. combine them with `cat', the result will not be a valid `tar' format
  1288. archive.
  1289.  
  1290.    This operation cannot be performed on some tape drives,
  1291. unfortunately, due to deficiencies in the formats thoes tape drives use.
  1292.  
  1293.    To append copies of an archive or archives to the end of another
  1294. archive, use `--concatenate' (`-A').  The source and target archives
  1295. must already exist and have been created using compatable format
  1296. parameters (
  1297. FIXME: pxref Matching Format Parameters
  1298.    ).
  1299.  
  1300.    `tar' will stop reading an archive if it encounters an
  1301. end-of-archive marker.  The `cat' utility does not remove
  1302. end-of-archive markers, and is therefore unsuitable for concatenating
  1303. archives.  `--concatenate' (`-A') removes the end-of-archive marker
  1304. from the target archive before each new archive is appended.
  1305. FIXME: xref ignore-zeros
  1306.  
  1307.    You must specify the source archives using `--file=ARCHIVE-NAME'
  1308. (`-f ARCHIVE-NAME') (
  1309. FIXME: pxref Archive
  1310. Name
  1311.    ).  If you do not specify the target archive , `tar' uses the value
  1312. of the environment variable `TAPE', or, if this has not been set, the
  1313. default archive name.
  1314.  
  1315.    The following example adds the contents of the archive
  1316. `hail/hail/fredonia' to the archive `stooges' (both archives were
  1317. created in examples above):
  1318.  
  1319.      tar --catenate --file=stooges hail/hail/fredonia
  1320.  
  1321.    If you need to retrieve files from an archive that was added to using
  1322. the `cat' utility, use the `--ignore-zeros' (`-i') option (
  1323. FIXME: pxref Archive Reading Options
  1324.    ).
  1325.  
  1326. 
  1327. File: tar.info,  Node: Removing Archive Members,  Next: Listing Archive Members,  Prev: Combining Archives,  Up: Basic tar Operations
  1328.  
  1329. Removing Archive Members
  1330. ========================
  1331.  
  1332.      *(This message will disappear, once this node revised.)*
  1333.  
  1334.    You can use the `--delete' option to remove members from an archive.
  1335. Name the members on the command line to be deleted.  This option will
  1336. rewrite the archive; because of this, it does not work on tape drives.
  1337. If you list no members to be deleted, nothing happens.
  1338.  
  1339.    To delete archive members from an archive, use `--delete'.  You must
  1340. specify the file names of the members to be deleted.  All archive
  1341. members with the specified file names will be removed from the archive.
  1342.  
  1343.    The following example removes the file `curley' from the archive
  1344. `stooges':
  1345.  
  1346.      tar --delete --file=stooges curley
  1347.  
  1348.    You can only use `--delete' on an archive if the archive device
  1349. allows you to write to any point on the media.
  1350.  
  1351.      *Warning:* Don't try to delete an archive member from a magnetic
  1352.      tape, lest you scramble the archive.  There is no safe way (except
  1353.      by completely re-writing the archive) to delete files from most
  1354.      kinds of magnetic tape.
  1355.  
  1356. FIXME: how about automatic detection of archive media?  give error
  1357. FIXME: unless the archive device is either an ordinary file or different
  1358. FIXME: input and output (--file=-).
  1359.  
  1360. 
  1361. File: tar.info,  Node: Listing Archive Members,  Next: Extracting Archive Members,  Prev: Removing Archive Members,  Up: Basic tar Operations
  1362.  
  1363. Listing Archive Members
  1364. =======================
  1365.  
  1366.      *(This message will disappear, once this node revised.)*
  1367.  
  1368.    The `--list' (`-t') option will list the names of members of the
  1369. archive.  Name the members to be listed on the command line (to modify
  1370. the way these names are interpreted,
  1371. FIXME: pxref Specifying Names to
  1372. tar
  1373.    ).  If you name no members, then `--list' (`-t') will list the names
  1374. of all the members of the archive.
  1375.  
  1376.    To see more than just the names of the members, use the `--verbose'
  1377. (`-v') option to cause `tar' to print out a listing similar to that of
  1378. `ls -l'.
  1379.  
  1380.    Listing the Contents of an Archive
  1381.  
  1382.    `--list' (`-t') prints a list of the file names of the archive
  1383. members on the standard output.  If you specify FILE NAME arguments on
  1384. the command line (or using the `--files-from=FILE-OF-NAMES' (`-T
  1385. FILE-OF-NAMES') option,
  1386.  
  1387. FIXME: pxref File Name Lists
  1388.    ), only the files you specify will be listed, and only if they exist
  1389. in the archive.  Files not specified will be ignored, unless they are
  1390. under a specific directory.
  1391.  
  1392.    If you include the `--verbose' (`-v') option, `tar' prints an `ls
  1393. -l' type listing for the archive.
  1394. FIXME: pxref Additional
  1395. Information
  1396.    , for a description of the `--verbose' (`-v') option.
  1397.  
  1398.    If the blocking factor of the archive differs from the default,
  1399. `tar' reports this.
  1400. FIXME: xref Blocking Factor
  1401.    .
  1402.  
  1403. FIXME: xref Archive Reading Options
  1404.    for a list of options which can be used to modify `--list' (`-t')'s
  1405. operation.
  1406.  
  1407.    This example prints a list of the archive members of the archive
  1408. `stooges':
  1409.  
  1410.      tar --list --file=stooges
  1411.  
  1412. `tar' responds:
  1413.  
  1414.      larry
  1415.      moe
  1416.      shemp
  1417.      marx/julius
  1418.      marx/alexander
  1419.      marx/karl
  1420.  
  1421.    This example generates a verbose list of the archive members of the
  1422. archive file `dwarves', which has a blocking factor of two:
  1423.  
  1424.      tar --list -v --file=blocks
  1425.  
  1426. `tar' responds:
  1427.  
  1428.      tar: Blocksize = 2 records
  1429.      -rw------- ringo/user 42 May   1 13:29 1990 .bashful
  1430.      -rw-rw-rw- ringo/user 42 Oct   4 13:29 1990 doc
  1431.      -rw-rw-rw- ringo/user 42 Jul  20 18:01 1969 dopey
  1432.      -rw-rw---- ringo/user 42 Nov  26 13:42 1963 grumpy
  1433.      -rw-rw-rw- ringo/user 42 May   5 13:29 1990 happy
  1434.      -rw-rw-rw- ringo/user 42 May   1 12:00 1868 sleepy
  1435.      -rw-rw-rw- ringo/user 42 Jul   4 17:29 1776 sneezy
  1436.  
  1437. 
  1438. File: tar.info,  Node: Extracting Archive Members,  Next: Comparing Archives Members with Files,  Prev: Listing Archive Members,  Up: Basic tar Operations
  1439.  
  1440. Extracting Archive Members
  1441. ==========================
  1442.  
  1443.      *(This message will disappear, once this node revised.)*
  1444.  
  1445.    Use `--extract' (`-x') or `--get' to extract members from an
  1446. archive.  For each member named (or for the entire archive if no
  1447. members are named) on the command line--or with
  1448. `--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES')--the a file is
  1449. created with the contents of the archive member.  The name of the file
  1450. is the same as the member name.
  1451.  
  1452.    Various options cause `tar' to extract more than just file contents,
  1453. such as the owner, the permissions, the modification date, and so forth.
  1454.  
  1455. FIXME: begin
  1456.    The `--same-permissions' (`-p') or `--preserve-permissions' options
  1457. cause `tar' to cause the new file to have the same permissions as the
  1458. original file did when it was placed in the archive.  Without this
  1459. option, the current `umask' is used to affect the permissions.
  1460.  
  1461.    When extrating, `tar' normally sets the modification time of the
  1462. file to the value recorded in the archive.  The `--modification-time'
  1463. (`-m') option causes `tar' to omit doing this.
  1464. FIXME: end
  1465.  
  1466.    To read archive members from the archive and write them into the file
  1467. system, use `--extract' (`-x').  The archive itself is left unchanged.
  1468.  
  1469.    If you do not specify the files to extract, `tar' extracts all the
  1470. files in the archive.  If you specify the name of a directory as a file
  1471. name argument, `tar' will extract all files which have been stored as
  1472. part of that directory.  If a file was stored with a directory name as
  1473. part of its file name, and that directory does not exist under the
  1474. working directory when the file is extracted, `tar' will create the
  1475. directory.
  1476. FIXME: xref Selecting Archive
  1477. Members
  1478.    , for information on specifying files to extract.
  1479.  
  1480.    The following example shows the extraction of the archive `stooges'
  1481. into an empty directory:
  1482.  
  1483.      tar --extract --file=stooges
  1484.  
  1485. Generating a listing of the directory (`ls') produces:
  1486.  
  1487.      larry
  1488.      moe
  1489.      shemp
  1490.      marx
  1491.  
  1492. The subdirectory `marx' contains the files `julius', `alexander' and
  1493. `karl'.
  1494.  
  1495.    If you wanted to just extract the files in the subdirectory `marx',
  1496. you could specify that directory as a file name argument in conjunction
  1497. with the `--extract' (`-x') operation:
  1498.  
  1499.      tar --extract --file=stooges marx
  1500.  
  1501.      *Warning:* Extraction can overwrite files in the file system.  To
  1502.      avoid losing files in the file system when extracting files from
  1503.      the archive with the same name, use the `--keep-old-files' (`-k')
  1504.      option (
  1505.      FIXME: pxref File Writing Options
  1506.      ).
  1507.  
  1508.    If the archive was created using `--block-size=512-SIZE' (`-b
  1509. 512-SIZE'), `--compress' (`-Z') or `--multi-volume' (`-M'), you must
  1510. specify those format options again when extracting files from the
  1511. archive (
  1512. FIXME: pxref Format Variations
  1513.    ).
  1514.  
  1515. * Menu:
  1516.  
  1517. * Archive Reading Options::
  1518. * File Writing Options::
  1519. * Scarce Disk Space::
  1520.  
  1521.