home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / info / tar.info-1 < prev    next >
Encoding:
GNU Info File  |  1996-10-12  |  47.6 KB  |  1,314 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: Top,  Next: Introduction,  Prev: (dir),  Up: (dir)
  29.  
  30. GNU tar
  31. *******
  32.  
  33.    This file documents `tar', a utility used to store, backup, and
  34. transport files.  It is a rudimentary documentation for the GNU tape
  35. (or disk) archiver.  It covers the release 1.11.8.
  36.  
  37.    This document has been quickly assembled from random notes and
  38. sources.  I will of course accept documentation bug reports, but please
  39. do not torture yourself into systematically reporting all inadequacies
  40. for unrevised nodes.
  41.  
  42. * Menu:
  43.  
  44. * Introduction::
  45. * Tutorial::
  46. * Invoking tar::
  47. * Basic tar Operations::
  48. * Specifying Names to tar::
  49. * Being Careful::
  50. * Format Control::
  51. * Media::
  52. * Backups and Restoration::
  53. * Date input formats::
  54. * Archive Format::
  55. * Index::
  56.  
  57.  -- The Detailed Node Listing --
  58.  
  59. Introduction
  60.  
  61. * What tar Does::
  62. * Authors::
  63. * Bug reports::
  64. * Support::
  65.  
  66. Support considerations
  67.  
  68. * Stability::
  69. * Rewriting::
  70. * Why maintaining::
  71. * MSDOS::
  72.  
  73. Tutorial Introduction to `tar'
  74.  
  75. * How to Create Archives::
  76. * How to List Archives::
  77. * How to Extract Members from an Archive::
  78. * How to Add Files to Existing Archives::
  79. * How to Delete Members from Archives::
  80.  
  81. How to Create Archives
  82.  
  83. * Creating Archives of Files bis::
  84. * Using tar in Verbose Mode bis::
  85. * How to Archive Directories::
  86. * Creating an Archive of a Subdirectory bis::
  87. * Compare bis::
  88. * Using Compare from the Superior Directory bis::
  89.  
  90. How to Archive Directories
  91.  
  92. * Creating an Archive of a Subdirectory bis::
  93.  
  94. How to List Archives
  95.  
  96. * Listing files in an archive bis::
  97. * Getting Additional File Information bis::
  98. * List A Specific File in an Archive bis::
  99. * Listing the Contents of a Stored Directory ter::
  100.  
  101. How to Extract Members from an Archive
  102.  
  103. * Extracting Files bis::
  104. * Extracting Files from an Archive ter::
  105. * Extracting Specific Files ter::
  106. * Extracting Directories ter::
  107.  
  108. How to Add Files to Existing Archives
  109.  
  110. * Append bis::
  111. * Update bis::
  112. * Concatenate bis::
  113.  
  114. Invoking GNU `tar'
  115.  
  116. * Synopsis::
  117. * Option Styles::
  118. * Options::
  119.  
  120. Many Styles for Options
  121.  
  122. * Mnemonic Options::
  123. * Short Options::
  124. * Old Options::
  125. * Mixing Styles::
  126.  
  127. All Available Options
  128.  
  129. * Device Options::
  130. * Blocking Options::
  131. * Classification Options::
  132.  
  133. Basic `tar' Operations
  134.  
  135. * Creating a New Archive::
  136. * Adding to an Existing Archive::
  137. * Updating an Archive::
  138. * Combining Archives::
  139. * Removing Archive Members::
  140. * Listing Archive Members::
  141. * Extracting Archive Members::
  142. * Comparing Archives Members with Files::
  143. * Matching Format Parameters::
  144.  
  145. Extracting Archive Members
  146.  
  147. * Archive Reading Options::
  148. * File Writing Options::
  149. * Scarce Disk Space::
  150.  
  151. Specifying Names to `tar'
  152.  
  153. * Changing the Archive Name::
  154. * Characteristics::
  155. * Selection Options::
  156.  
  157. Selecting Files by Characteristic
  158.  
  159. * Reading Names from a File::
  160. * Excluding Some Files::
  161. * Operating Only on New Files::
  162. * Crossing Filesystem Boundaries::
  163.  
  164. Local file selection
  165.  
  166. * Changing Directory::
  167. * Absolute File Names::
  168.  
  169. Being Even More Careful
  170.  
  171. * Documentation::
  172. * Checking Progress::
  173. * Interactive Operation::
  174. * Write Verification::
  175. * Comparing::
  176. * Portability::
  177. * Write Protection::
  178.  
  179. Making `tar' Archives More Portable
  180.  
  181. * Portable Names::
  182. * Symbolic Links::
  183. * Old V7 and POSIX::
  184. * Checksumming Problems::
  185.  
  186. Controlling the Archive Format
  187.  
  188. * Attributes Options::
  189. * Type Options::
  190. * Compression::
  191. * Special Options for Archiving::
  192. * Archive Structure::
  193. * Modifiers Options::
  194.  
  195. Using Less Space through Compression
  196.  
  197. * Compressed Archives::
  198. * Dealing with Compressed Archives::
  199. * Sparse Files::
  200.  
  201. Tapes and Other Archive Media
  202.  
  203. * Device::
  204. * Blocking::
  205. * Many::
  206. * Using Multiple Tapes::
  207. * Archive Label::
  208.  
  209. Blocking
  210.  
  211. * Format Variations::
  212. * Blocking Factor::
  213.  
  214. Many archives on one tape
  215.  
  216. * Tape Positioning::
  217. * mt::
  218.  
  219. Using Multiple Tapes
  220.  
  221. * Multi-Volume Archives::
  222. * Tape Files::
  223.  
  224. Performing Backups and Restoring Files
  225.  
  226. * Full Dumps::
  227. * Inc Dumps::
  228. * incremental and listed-incremental::
  229. * Backup Levels::
  230. * Backup Parameters::
  231. * Scripted Backups::
  232. * Scripted Restoration::
  233.  
  234. Setting Parameters for Backups and Restoration
  235.  
  236. * backup-specs example::
  237. * Script Syntax::
  238.  
  239. Date input formats
  240.  
  241. * General date syntax::
  242. * Calendar date item::
  243. * Time of day item::
  244. * Timezone item::
  245. * Day of week item::
  246. * Relative item in date strings::
  247. * Pure numbers in date strings::
  248. * Authors of getdate::
  249.  
  250. Format of `tar' archives
  251.  
  252. * Standard::
  253. * Extensions::
  254. * cpio::
  255.  
  256. 
  257. File: tar.info,  Node: Introduction,  Next: Tutorial,  Prev: Top,  Up: Top
  258.  
  259. Introduction
  260. ************
  261.  
  262.    This chapter introduces of a few words which will recur all over
  263. this manual, like "archive", "member", "name", "unpack", etc.  It then
  264. explains who wrote GNU `tar' and its documentation, and says where to
  265. send bug reports or comments.
  266.  
  267. * Menu:
  268.  
  269. * What tar Does::
  270. * Authors::
  271. * Bug reports::
  272. * Support::
  273.  
  274. 
  275. File: tar.info,  Node: What tar Does,  Next: Authors,  Prev: Introduction,  Up: Introduction
  276.  
  277. What `tar' Does
  278. ===============
  279.  
  280.    The `tar' program is used to create and manipulate `tar' archives.
  281. An "archive" is a single file which contains within it the contents of
  282. many files.  In addition, the archive identifies the names of the
  283. files, their owner, and so forth.  (Archives record access permissions,
  284. user and group, size in bytes, and last modification time.  Some
  285. archives also record the file names in each archived directory, as well
  286. as other file and directory information.)
  287.  
  288.    The files inside an archive are called "members".  Within this
  289. manual, we use the term "file" to refer only to files accessible in the
  290. normal ways (by `ls', `cat', and so forth), and the term "members" to
  291. refer only to the members of an archive.  Similarly, a "file name" is
  292. the name of a file, as it resides in the filesystem, and a "member
  293. name" is the name of an archive member within the archive.
  294.  
  295.    Initially, `tar' archives were used to store files conveniently on
  296. magnetic tape.  The name `tar' comes from this use; it stands for:
  297. `t'ape `ar'chiver.  Despite the utility's name, `tar' can direct its
  298. output to any available device, as well as store it in a file or direct
  299. it to another program via a pipe.  `tar' may even access, as archives,
  300. remote devices or files.
  301.  
  302.    You can use `tar' archives in many ways.  We want to stress a few of
  303. them: storage, backup or transportation.
  304.  
  305. Storage
  306.      Often, `tar' archives are used to store related files for
  307.      convenient file transfer over a network.  For example, the GNU
  308.      Project distributes its software bundled into `tar' archives, so
  309.      that all the files relating to a particular program (or set of
  310.      related programs) can be transferred as a single unit.
  311.  
  312.      A magnetic tape can store several files in sequence, but has no
  313.      names for them, just relative position on the tape.  A `tar'
  314.      archive or something like it is one way to store several files on
  315.      one tape and retain their names.  Even when the basic transfer
  316.      mechanism can keep track of names, as FTP can, the nuisance of
  317.      handling multiple files, directories, and multiple links, makes
  318.      `tar' archives an attractive method.
  319.  
  320.      Archive files are also used for long-term storage, which you can
  321.      think of as transportation from one time to another.
  322.  
  323. Backup
  324.      Because the archive created by `tar' is capable of preserving file
  325.      information and directory structure, `tar' is commonly used for
  326.      performing full and incremental backups of disks, putting all
  327.      together bunch of files possibly pertaining to many users and
  328.      different projects, to secure against accidental destruction of
  329.      those disks.
  330.  
  331.      The GNU version of `tar' has special features that allow it to be
  332.      used to make incremental and full dumps of all the files in a
  333.      filesystem.
  334.  
  335. Transportation
  336.      Archive files can be used for transporting a group of files from
  337.      one system to another: put all relevant files into an archive on
  338.      one computer system, transfer the archive to another, and extract
  339.      the contents there.  The basic transfer medium might be magnetic
  340.      tape, Internet FTP, or even electronic mail (though you must
  341.      encode the archive with `uuencode' or some functional equivalent
  342.      in order to transport it properly by mail).  Both machines do not
  343.      have to use the same operating system, as long as they both
  344.      support the `tar' program.
  345.  
  346.      Piping one `tar' to another is an easy way to copy a directory's
  347.      contents from one disk to another, while preserving the dates,
  348.      modes, owners and link structure of all the files therein.  `tar'
  349.      is also ideal for transferring directories over networks.  We
  350.      sometimes see a copy of `tar' packing many files into one archive
  351.      on one machine, and sending the produced archive over a pipe over
  352.      the network to another copy of `tar' on another machine, reading
  353.      its archive from the pipe and unpacking all files there.
  354.  
  355.    The `tar' program provides the ability to create `tar' archives, as
  356. well as for various other kinds of manipulation.  For example, you can
  357. use `tar' on previously created archives to extract files, to store
  358. additional files, or to update or list files already stored.  The term
  359. "extraction" is used to refer to the process of copying an archive
  360. member into a file in the filesystem.  One might speak of extracting a
  361. single member.  Extracting all the members of an archive is often
  362. called extracting the archive.  Also, the term "unpack" is used to
  363. refer to the extraction of many or all the members of an archive.
  364.  
  365.    Conventionally, `tar' archives are given names ending with `.tar'.
  366. This is not necessary for `tar' to operate properly, but this manual
  367. follows the convention in order to get the reader used to seeing it.
  368.  
  369.    Occasionally, `tar' archives are referred to as `tar' files, archive
  370. members are referred to as files, or entries.  For people familiar with
  371. the operation of `tar', this causes no difficulty.  However, this
  372. manual consistently uses the terminology above in referring to archives
  373. and archive members, to make it easier to learn how to use `tar'.
  374.  
  375. 
  376. File: tar.info,  Node: Authors,  Next: Bug reports,  Prev: What tar Does,  Up: Introduction
  377.  
  378. GNU `tar' Authors
  379. =================
  380.  
  381.    GNU `tar' was originally written by John Gilmore, and modified by
  382. many people.  The GNU enhancements were written by Jay Fenlason, and
  383. the whole package has been further maintained by Michael Bushnell, then
  384. Franc,ois Pinard, with the help of numerous and kind users.  I wish to
  385. stress that `tar' is somewhat a collective work, and owe much to all
  386. those people who reported problems, offerred solutions and other
  387. insights, or shared their thoughts and suggestions.  Even if we lost
  388. track of many of those contributors, a partial list can be found in the
  389. `THANKS' file from the GNU `tar' distribution.
  390.  
  391.    Jay Fenlason put together a draft of a GNU `tar' manual, also
  392. borrowing notes from the original man page from John Gilmore, this
  393. draft has been distributed in `tar' versions 1.04 (or even before?)
  394. through 1.10, then withdrawn in version 1.11.  Michael Bushnell and Amy
  395. Gorin worked at a tutorial and manual for GNU `tar', and left a few
  396. unpublished versions of each.  For version 1.11.8, Franc,ois Pinard put
  397. together a new manual by grabbing from all these sources and merging
  398. them in a single manual.
  399.  
  400.    I heard that there is another manual in the works, by another team,
  401. which should say everything about archives and related utilities, and
  402. which will surely be nicer than this one.  In the meantime, please
  403. consider this manual is a placeholder for `tar' option list and a few
  404. random notes the maintainer wants to save somewhere, so users can read
  405. them.  I wish GNU `tar' users will be happier with this imperfect
  406. manual than with no documentation at all.
  407.  
  408. 
  409. File: tar.info,  Node: Bug reports,  Next: Support,  Prev: Authors,  Up: Introduction
  410.  
  411. Reporting bugs or suggestions
  412. =============================
  413.  
  414.    Please report problems or suggestions about this program to
  415. `bug-gnu-utils@prep.ai.mit.edu'.  You may also write directly, and less
  416. officially, to `pinard@iro.umontreal.ca'.  There is a lot of mail
  417. flowing about `tar', and some accumulated in the past years.  You might
  418. expect a quick acknowledgement of your invoices, but the proper
  419. handling of your reports may be delayed for a long while.
  420.  
  421.    Many nodes of this document have not been revised much, these all
  422. start with a little comment telling so.  I accept documentation bug
  423. reports, of course.  But please do not torture yourself into
  424. systematically reporting all inadequacies for the unrevised nodes of
  425. this document, unless you really feel like revising them.
  426.  
  427. 
  428. File: tar.info,  Node: Support,  Prev: Bug reports,  Up: Introduction
  429.  
  430. Support considerations
  431. ======================
  432.  
  433.    This informal appendix is for the maintainer to share a few words
  434. and thoughts, while considering GNU `tar' support.
  435.  
  436. * Menu:
  437.  
  438. * Stability::
  439. * Rewriting::
  440. * Why maintaining::
  441. * MSDOS::
  442.  
  443. 
  444. File: tar.info,  Node: Stability,  Next: Rewriting,  Prev: Support,  Up: Support
  445.  
  446. Stability of GNU `tar'
  447. ----------------------
  448.  
  449.    User reports mainly fall in three categories: portability problems,
  450. execution bugs, and requests for enhancements.  For 1.11.X, the
  451. emphasis has been on solving portability problems, then trying to make
  452. GNU `tar' more solid.  Enhancements have fairly low priority, yet I
  453. sometime slip one in just for taking a kind of rest :-).
  454.  
  455.    Many bugs have been corrected since 1.11.2.  If you are curious,
  456. glance through ChangeLog.  I had only very few reports for things that
  457. *might* be new bugs not present in 1.11.2.  If you are really curious,
  458. and have access to the FSF machines, see `/gd/gnu/tar/rmail/' hierarchy
  459. for all reports.  Subdirectories `0', `1', `2' and `3' represent
  460. decreasing levels in priority.  Most problems in there were reported
  461. against 1.10, 1.11 or 1.11.2 and still exist.  The only thing I have
  462. consciously broken between 1.11.2 and 1.11.5 is `--record-number'
  463. (`-R'), because I wanted some modification to be done to
  464. `gnulib/error.c', which is outside my control.  This modification is
  465. now done, but I did not revisit this area yet.
  466.  
  467.    Here is my candid opinion.  GNU `tar' has many areas of
  468. unreliability.  See `BACKLOG' for the horrorful picture of the
  469. situation.  Yet, for most users and usages, GNU `tar' looks very
  470. dependable.  For me as a mere user, GNU `tar' did not give problems in
  471. years.  And I think it offers a lot of functionality.  Many problems
  472. have been solved since 1.11.2, even if true that many more remain to be
  473. solved.  I'm not discouraged myself and feel positive about maintaining
  474. it, simply because when I bite, that usually lasts for quite long.  I
  475. might not have all the time I would want, but I surely have good will
  476. and am happily surrounded by many collaborating pretesters.  So, I
  477. still think GNU `tar' is on the winning side in the long run.
  478.  
  479. 
  480. File: tar.info,  Node: Rewriting,  Next: Why maintaining,  Prev: Stability,  Up: Support
  481.  
  482. Should we rewrite the thing?
  483. ----------------------------
  484.  
  485.    Working in `tar' sources is not always pleasurable.  The problem is
  486. that `tar' sources are very fragile.  Just cleaning around breaks
  487. things.  The current sequence of prereleases is for slowly trying to
  488. solidify it, so `tar' becomes more maintainable.  I think that the
  489. ugliness of sources could be corrected to a certain extent, too.
  490.  
  491.    A few efforts to replace GNU `tar' have been done already and it
  492. seems that all failed so far.  A toy program, for me, is another kind
  493. of failure.  I think people underestimate the number of portability
  494. problems such a program can raise.  This is not only a matter of
  495. programming style, there is really a wide variability in systems out
  496. there.  GNU `tar' has a long history, met a rich variety of porting
  497. problems, machine peculiarities, system idiosyncrasies, which are
  498. unrelated to programming style.  My own opinion is that we cannot
  499. dismiss all the experience gleaned along the years, and saved (if not
  500. hidden) in GNU `tar' sources, pretending to start anew, from scratch.
  501.  
  502.    Even if a new program replacing GNU `tar' would be marvelous, GNU
  503. `tar' stalled for a few years waiting for such a program, and we are
  504. now faced to nothing, with hundreds of user reports to catch on.  We
  505. need a working archiver *now*, and cannot live on promises.  Any new
  506. program will take hundreds of user reports, and many years, to
  507. stabilize enough to become a plausible `tar' replacement.  I rather
  508. plan to clean up GNU `tar'.  This alone is a big task for me, because
  509. GNU `tar' coding is not ideal, and I have to find ways to transform it
  510. slowly, while having it fully working at all times.
  511.  
  512. 
  513. File: tar.info,  Node: Why maintaining,  Next: MSDOS,  Prev: Rewriting,  Up: Support
  514.  
  515. Why maintaining it?
  516. -------------------
  517.  
  518.    I confess that I am a little afraid of `tar' maintainance.  It is
  519. difficult for many reasons, the first tree being more evident than the
  520. others:
  521.  
  522.    * the algorithmic design was initially oriented for machines having
  523.      very small memory, it was later much adapted for new features
  524.      without doing everything necessary for the whole to stay clean;
  525.  
  526.    * the wide visibility of `tar' forces many stunts at portability;
  527.  
  528.    * GNU `tar' has to be sensitive to file systems and device variance.
  529.  
  530.    * GNU central has been seduced by some users promising to write
  531.      wonderful `tar' replacements, which never came, so development has
  532.      been put aside for years, while bug reports accumulated;
  533.  
  534.    * the `tar' manual has been withdrawn, promising users a fine
  535.      replacement for it, so raising their expectations;
  536.  
  537.    * maintenance was once split between four maintainers (one for
  538.      `tar', one for `mt', another for scripts, and a team for
  539.      documentation), and also, `rtapelib.[ch]' from `tar' is used in
  540.      `cpio', and synchronisation has not always been easy.
  541.  
  542.    However, even if difficult, I do feel like doing a careful cleanup,
  543. so `tar' would become less painful to maintain after a while (and less
  544. subject to criticism).  And besides, I'm surrounded by a marvelous team
  545. of pretesters and by many other collaborating users, which I should
  546. learn to serve better.  Getting more experience with maintainance in
  547. GNU, I hope being careful enough modifying `tar' so not hurting users
  548. too much, being aware that `tar' is a sensitive product in GNU.  Once
  549. cleaned up, I might be happy to return `tar' maintainance to someone
  550. else...
  551.  
  552.    `tar' requires more work alone that all my other things together,
  553. and I have to resist being swallowed whole in it.  This resistance
  554. makes `tar' development somewhat slower.  Sorry!
  555.  
  556. 
  557. File: tar.info,  Node: MSDOS,  Prev: Why maintaining,  Up: Support
  558.  
  559. MSDOS and other systems?
  560. ------------------------
  561.  
  562.    GNU does not necessarily support non-UNIX systems, that is to say,
  563. MSDOS is not supported.  It is very true that ports can sometimes be
  564. very intrusive in the sources, cluttering them significantly with
  565. conditionals and extra code, and distract GNU maintainers from the main
  566. development line.
  567.  
  568.    However, a special argument might be made for `tar'.  Both `tar' and
  569. `gzip' are the required tools for getting something out of the GNU
  570. archives, `tar' should be more opened to ports than the GNU rule
  571. states.  Jean-loup did a tremendous job at porting `gzip' on smaller
  572. systems.  It would be comfortable that a few other GNU tools be
  573. available on MSDOS and others, among which `tar'.  These ports for
  574. `tar' have theoretically no priority at all.  Nevertheless, a port is
  575. interesting, because `tar' is so central in GNU distributions, and
  576. `gzip' is already ported.
  577.  
  578.    Some porting efforts have been done in the past.  There are traces of
  579. a few exchanges on this subject in `BACKLOG'.  GNU `tar' sources have
  580. been modified a lot recently at a cosmetic level, and I would certainly
  581. have a hard time integrating diffs provided by someone else.  If people
  582. want porting `tar' to MSDOS or other non-UNIX systems, they should be
  583. committed in supporting their ports after the fact, as I cannot do it
  584. myself.
  585.  
  586. 
  587. File: tar.info,  Node: Tutorial,  Next: Invoking tar,  Prev: Introduction,  Up: Top
  588.  
  589. Tutorial Introduction to `tar'
  590. ******************************
  591.  
  592.    This chapter guides you through some basic examples of `tar'
  593. operations.  If you already know how to use some other version of
  594. `tar', then you probably don't need to read this chapter.  This chapter
  595. omits complicated details about many of the ways `tar' works.  See
  596. later chapters for full information.
  597.  
  598.    Before proceeding further with this tutorial chapter, be sure you
  599. understand already and clearly what is meant by "archive" and "archive
  600. member".
  601. FIXME: xref What tar Does
  602.    .
  603.  
  604.    This chapter guides you through some basic examples of `tar'
  605. operations.  In the examples, the lines you should type are preceded by
  606. a `%', which is a typical shell prompt.  We use mnemonic forms of
  607. operations and options in the examples, and in discussions in the text,
  608. but short forms produce the same result.
  609.  
  610.    Most of the options to `tar' come in both long forms and short
  611. forms.  The options described in this tutorial have the following
  612. abbreviations (except `--delete', which has no shorthand form):
  613.  
  614. `--create'
  615.      `-c'
  616.  
  617. `--list'
  618.      `-t'
  619.  
  620. `--extract'
  621.      `-x'
  622.  
  623. `--append'
  624.      `-r'
  625.  
  626. `--verbose'
  627.      `-v'
  628.  
  629. `--file=ARCHIVE-NAME'
  630.      `-f ARCHIVE-NAME'
  631.  
  632.    These options make typing long `tar' commands easier.  For example,
  633. instead of typing
  634.      tar --create --file=/tmp/afiles.tar --verbose apple angst asparagus
  635.    you can type
  636.      tar -c -f /tmp/afiles.tar -v apple angst asparagus
  637.  
  638.    For more information on option syntax,
  639. FIXME: ref Invoking tar
  640.    .  In discussions in the text, when we present some mnemonic option,
  641. we also give the corresponding short option within parentheses.
  642.  
  643. * Menu:
  644.  
  645. * How to Create Archives::
  646. * How to List Archives::
  647. * How to Extract Members from an Archive::
  648. * How to Add Files to Existing Archives::
  649. * How to Delete Members from Archives::
  650.  
  651. 
  652. File: tar.info,  Node: How to Create Archives,  Next: How to List Archives,  Prev: Tutorial,  Up: Tutorial
  653.  
  654. How to Create Archives
  655. ======================
  656.  
  657.      *(This message will disappear, once this node revised.)*
  658.  
  659.    To create a new archive, use the `--create' (`-c') option to `tar'.
  660. You can use options to specify the name and format of the archive (as
  661. well as other characteristics), and you can use file name arguments to
  662. specify which files and directories are to be put in the archive.
  663.  
  664. FIXME: xref Creating
  665.    , for more information about the `--create' (`-c') operation.
  666.  
  667.    To create a new archive, use the `--create' (`-c') option to `tar'.
  668. You should generally use the `--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME')
  669. option to specify the name the `tar' archive will have.  Then specify
  670. the names of the files you wish to place in the new archive.  For
  671. example, to place the files `apple', `angst', and `asparagus' into an
  672. archive named `afiles.tar', use the following command:
  673.  
  674.      tar --create --file=afiles.tar apple angst asparagus
  675.  
  676.    The order of the arguments is not important when using mnemonic
  677. option style.  You could also say:
  678.  
  679.      tar apple --create angst --file=afiles.tar asparagus
  680.  
  681.    This order is harder to understand however.  In this manual, we will
  682. list the arguments in a reasonable order to make the commands easier to
  683. understand, but you can type them in any order you wish.
  684.  
  685.    If you don't specify the names of any files to put in the archive,
  686. then `tar' will create an empty archive.  So, the following command
  687. will create an archive with nothing in it:
  688.  
  689.      tar --create --file=empty-archive.tar
  690.  
  691.    Whenever you use `--create' (`-c'), `tar' will erase the current
  692. contents of the file named by `--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME')
  693. if it exists.  To add files to an existing archive, you need to use a
  694. different option.
  695. FIXME: xref Adding to Archives, for information on how to do this.
  696.  
  697.    When an archive is created through `--create' (`-c'), the member
  698. names of the members of the archive are exactly the same as the file
  699. names as you typed them in the `tar' command.  So, the member names of
  700. `afiles' (as created by the first example above) are `apple', `angst',
  701. and `asparagus'.  However, suppose an archive were created with this
  702. command:
  703.  
  704.      tar --create --file=bfiles.tar ./balloons baboon ./bodacious
  705.  
  706.    Then, the three files `balloons', `baboon', and `bodacious' would
  707. get placed in the archive (because `./' is a synonym for the current
  708. directory), but their member names would be `./balloons', `baboon', and
  709. `./bodacious'.
  710.  
  711.    If you want to see the progress of `tar' as it writes files into the
  712. archive, you can use the `--verbose' (`-v') option.
  713.  
  714.    If one of the files named with `--create' (`-c') is a directory, then
  715. the operation of `tar' is more complicated.
  716. FIXME: xref Tar and Directories,
  717. FIXME: the last section of this tutorial, for more information.
  718.  
  719.    If you don't specify the `--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME')
  720. option, then `tar' will use a default.  Usually this default is some
  721. physical tape drive attached to your machine.  If there is no tape
  722. drive attached, or the default is not meaningful, then `tar' will print
  723. an error message.  This error message might look roughly like one of
  724. the following:
  725.  
  726.      tar: can't open /dev/rmt8 : No such device or address
  727.      tar: can't open /dev/rsmt0 : I/O error
  728.  
  729.    If you get an error like this, mentioning a file you didn't specify
  730. (`/dev/rmt8' or `/dev/rsmt0' in the examples above), then `tar' is
  731. using a default value for `--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME').
  732. You should generally specify a `--file=ARCHIVE-NAME' (`-f
  733. ARCHIVE-NAME') argument whenever you use `tar', rather than relying on
  734. a default.
  735.  
  736.    To create a new archive, use the `--create' (`-c') option to `tar'.
  737. You can use options to specify the name and format of the archive (as
  738. well as other characteristics), and you can use file name arguments to
  739. specify which files to put in the archive.  If you don't use any
  740. options or file name arguments, `tar' will use default values.
  741. FIXME: xref Creating Example
  742.    , for more information about the `--create' (`-c') option.
  743.  
  744. * Menu:
  745.  
  746. * Creating Archives of Files bis::
  747. * Using tar in Verbose Mode bis::
  748. * How to Archive Directories::
  749. * Creating an Archive of a Subdirectory bis::
  750. * Compare bis::
  751. * Using Compare from the Superior Directory bis::
  752.  
  753. 
  754. File: tar.info,  Node: Creating Archives of Files bis,  Next: Using tar in Verbose Mode bis,  Prev: How to Create Archives,  Up: How to Create Archives
  755.  
  756. Creating Archives of Files
  757. --------------------------
  758.  
  759.      *(This message will disappear, once this node revised.)*
  760.  
  761.    This example shows you how to create an archive file in your working
  762. directory containing other files in the same directory.  The three
  763. files you archive in this example are called `blues', `folk', and
  764. `jazz'.  The archive file is called `records'.  While the archive in
  765. this example is written to the file system, it could also be written to
  766. tape.  (If you want to follow along with this and future examples,
  767. create a practice subdirectory containing files with these names.  To
  768. create the directory, type `mkdir practice' at the system prompt.  You
  769. can create the files using a text editor, such as `emacs').
  770.  
  771.    While in the directory containing the files you want to archive, list
  772. the directory's contents.
  773.  
  774.    Type:
  775.  
  776.      % cd practice
  777.      % ls
  778.  
  779. The system responds:
  780.  
  781.      blues    folk    jazz
  782.      %
  783.  
  784. This is to check that the files to be archived do in fact exist in the
  785. working directory, and to check that the archive name you have chosen
  786. isn't already in use.  If it is, `tar' will overwrite the old archive
  787. and its contents will be lost.
  788.  
  789.    Then,
  790.    * Create a new archive by giving `--create' (`-c') to `tar'.
  791.  
  792.    * Explicitly name the archive file being
  793.      created--`--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME').  If you don't
  794.      use this option `tar' will write the archive to the default
  795.      storage device, which varies from system to system.
  796.  
  797.    * Specify which files to put into the archive.  If you don't specify
  798.      any FILE NAME arguments, `tar' will archive everything in the
  799.      working directory.
  800.  
  801. Type:
  802.      % tar --create --file=records blues folk jazz
  803.  
  804. If you now list the contents of the working directory (`ls'), you will
  805. find the archive file listed as well as the files you saw previously.
  806.  
  807.      % ls
  808.      blues folk jazz records
  809.      %
  810.  
  811.    This example shows you how to create an archive file in the working
  812. directory containing other files in the working directory.  The three
  813. files you archive in this example are called `blues', `folk', and
  814. `jazz'.  The archive file is called `records'.  While the archive in
  815. this example is written to the file system, it could also be written to
  816. any other device.
  817.  
  818.    (If you want to follow along with this and future examples, create a
  819. directory called `practice' containing files called `blues', `folk' and
  820. `jazz'.  To create the directory, type `mkdir practice' at the system
  821. prompt.  It will probably be easiest to create the files using a text
  822. editor, such as Emacs.)
  823.  
  824.    First, change into the directory containing the files you want to
  825. archive:
  826.  
  827.      % cd practice
  828.  
  829.    `~/practice' is now your working directory.
  830.  
  831.    Then, check that the files to be archived do in fact exist in the
  832. working directory, and make sure there isn't already a file in the
  833. working directory with the archive name you intend to use.  If you
  834. specify an archive file name that is already in use, `tar' will
  835. overwrite the old file and its contents will be lost.
  836.  
  837.    To list the names of files in the working directory, type:
  838.  
  839.      % ls
  840.  
  841.    The system responds:
  842.  
  843.      blues   folk    jazz
  844.      %
  845.  
  846.    Then,
  847.  
  848.    * Create a new archive by giving the `--create' (`-c') option to
  849.      `tar'.
  850.  
  851.    * Explicitly name the archive file being
  852.      created--`--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME').  If you don't
  853.      use this option `tar' will write the archive to the default
  854.      storage device, which varies from system to system.
  855.      FIXME: this syntax may change.  OK now--check before printing
  856.  
  857.      `tar' interprets archive file names relative to the working
  858.      directory.  Make sure you have write access to the working
  859.      directory before using `tar'.
  860.  
  861.    * Specify which files to put into the archive (`tar' interprets file
  862.      names relative to the working directory).  If you don't use any
  863.      NAME arguments, `tar' will archive everything in the working
  864.      directory.
  865.  
  866.    Type:
  867.      % tar --create --file=records blues folk jazz
  868.  
  869.    If you now list the contents of the working directory (`ls'), you
  870. will find the archive file listed as well as the files you saw
  871. previously.
  872.  
  873.      % ls
  874.      blues folk jazz records
  875.      %
  876.  
  877. 
  878. File: tar.info,  Node: Using tar in Verbose Mode bis,  Next: How to Archive Directories,  Prev: Creating Archives of Files bis,  Up: How to Create Archives
  879.  
  880. Using `tar' in Verbose Mode
  881. ---------------------------
  882.  
  883.      *(This message will disappear, once this node revised.)*
  884.  
  885.    If you include the `--verbose' (`-v') option on the command line,
  886. `tar' will list the files it is acting on as it is working.  The
  887. example above in verbose mode would be:
  888.  
  889.      % tar --create --file=records --verbose blues folk jazz
  890.      blues
  891.      folk
  892.      jazz
  893.  
  894. The first line, which is preceeded by a `%', is the command line.  The
  895. lines after the first line are generated by `tar' as it works.  In the
  896. following examples we usually use verbose mode, though it is almost
  897. never required.
  898.  
  899.    If you include the `--verbose' (`-v') option on the command line,
  900. `tar' will list the files it is acting on as it is working. In verbose
  901. mode, the creation example above would appear as:
  902.  
  903.      % tar --create --file=records --verbose blues folk jazz
  904.      blues
  905.      folk
  906.      jazz
  907.  
  908.    The first line is the command typed in by the user.  The remaining
  909. lines are generated by `tar'.  In the following examples we usually use
  910. verbose mode, though it is almost never required.
  911.  
  912. 
  913. File: tar.info,  Node: How to Archive Directories,  Next: Creating an Archive of a Subdirectory bis,  Prev: Using tar in Verbose Mode bis,  Up: How to Create Archives
  914.  
  915. How to Archive Directories
  916. --------------------------
  917.  
  918.      *(This message will disappear, once this node revised.)*
  919.  
  920.    When the names of files or members specify directories, the
  921. operation of `tar' is more complex.  Generally, when a directory is
  922. named, `tar' also operates on all the contents of the directory,
  923. recursively.  Thus, to `tar', the file name `/' names the entire file
  924. system.
  925.  
  926.    To archive the entire contents of a directory, use `--create' (`-c')
  927. or `--append' (`-r') as usual, and specify the name of the directory.
  928. For example, to archive all the contents of the current directory, use
  929. `tar --create --file=ARCHIVE-NAME .'.  Doing this will give the archive
  930. members names starting with `./'.  To archive the contents of a
  931. directory named `foodir', use `tar --create --file=ARCHIVE-NAME
  932. foodir'.  In this case, the member names will all start with `foodir/'.
  933.  
  934.    If you give `tar' a command such as `tar --create --file=foo.tar .',
  935. it will report `tar: foo.tar is the archive; not dumped'.  This happens
  936. because the archive `foo.tar' is created before putting any files into
  937. it.  Then, when `tar' attempts to add all the files in the directory
  938. `.' to the archive, it notices that the file `foo.tar' is the same as
  939. the archive, and skips it.  (It makes no sense to put an archive into
  940. itself.)  GNU `tar' will continue in this case, and create the archive
  941. as normal, except for the exclusion of that one file.  Other versions
  942. of `tar', however, are not so clever, and will enter an infinite loop
  943. when this happens, so you should not depend on this behavior.  In
  944. general, make sure that the archive is not inside a directory being
  945. dumped.
  946.  
  947.    When extracting files, you can also name directory archive members on
  948. the command line.  In this case, `tar' extracts all the archive members
  949. whose names begin with the name of the directory.  As usual, `tar' is
  950. not particularly clever about interpreting member names.  The command
  951. `tar --extract --file=ARCHIVE-NAME .' will not extract all the contents
  952. of the archive, but only those members whose member names begin with
  953. `./'.
  954.  
  955. * Menu:
  956.  
  957. * Creating an Archive of a Subdirectory bis::
  958.  
  959. 
  960. File: tar.info,  Node: Creating an Archive of a Subdirectory bis,  Next: Compare bis,  Prev: How to Archive Directories,  Up: How to Create Archives
  961.  
  962. Creating an Archive from the Superior Directory
  963. -----------------------------------------------
  964.  
  965.      *(This message will disappear, once this node revised.)*
  966.  
  967.    You can archive a directory by specifying its directory name as a
  968. file name argument to `tar'.  The files in the directory will be
  969. archived relative to the working directory, and the directory will be
  970. re-created along with its contents when the archive is extracted.
  971.  
  972.    To archive a directory, first move to its superior directory.  If you
  973. have been following the tutorial, you should type:
  974.  
  975.      % cd ..
  976.      %
  977.  
  978.    Once in the superior directory, you can specify the subdirectory as a
  979. file name argument.  To store the directory `practice' in the archive
  980. file `music', type:
  981.  
  982.      % tar --create --verbose --file=music practice
  983.  
  984. `tar' should output:
  985.  
  986.      practice/
  987.      practice/blues
  988.      practice/folk
  989.      practice/jazz
  990.      practice/records
  991.  
  992.    Note that the archive thus created is not in the subdirectory
  993. `practice', but rather in the working directory--the directory from
  994. which `tar' was invoked.  Before trying to archive a directory from its
  995. superior directory, you should make sure you have write access to the
  996. superior directory itself, not only the directory you are trying
  997. archive with `tar'.  Trying to store your home directory in an archive
  998. by invoking `tar' from the root directory will probably not work.
  999. FIXME: xref absolute-names
  1000.    (Note also that `records', the original archive file, has itself
  1001. been archived.  `tar' will accept any file as a file to be archived,
  1002. regardless of its content.  When `music' is extracted, the archive file
  1003. `records' will be re-written into the file system).
  1004.  
  1005.    You can store a directory in an archive by using the directory name
  1006. as a file name argument to `tar'.  When you specify a directory file,
  1007. `tar' archives the directory file and all the files it contains.  The
  1008. names of the directory and the files it contains are stored in the
  1009. archive relative to the current working directory-when the directory is
  1010. extracted they will be written into the file system relative to the
  1011. working directory at that time.
  1012. FIXME: add an xref to --absolute-names
  1013.  
  1014.    To archive a directory, first move to its superior directory.  If you
  1015. have been following the tutorial, you should type:
  1016.  
  1017.      % cd ..
  1018.      %
  1019.  
  1020.    Once in the superior directory, specify the subdirectory using a
  1021. file name argument.  To store the directory file `~/practice' in the
  1022. archive file `music', type:
  1023.  
  1024.      % tar --create --verbose --file=music practice
  1025.  
  1026.    `tar' should respond:
  1027.  
  1028.      practice/
  1029.      practice/blues
  1030.      practice/folk
  1031.      practice/jazz
  1032.      practice/records
  1033.  
  1034.    Note that `~/practice/records', another archive file, has itself
  1035. been archived.  `tar' will accept any file as a file to be archived,
  1036. even an archive file.
  1037.  
  1038. FIXME: symbolic links and changing directories are now in main body,
  1039. FIXME: not in tutorial.
  1040.  
  1041. 
  1042. File: tar.info,  Node: Compare bis,  Next: Using Compare from the Superior Directory bis,  Prev: Creating an Archive of a Subdirectory bis,  Up: How to Create Archives
  1043.  
  1044. Comparing Files in an Archive with Files in the File System
  1045. -----------------------------------------------------------
  1046.  
  1047.      *(This message will disappear, once this node revised.)*
  1048.  
  1049.    While the `--list' (`-t') operation with the `--verbose' (`-v')
  1050. option specified is useful in keeping files in the archive current with
  1051. files in the file system (by allowing the user to compare size and
  1052. modification dates), it is simpler to have `tar' itself compare file
  1053. attributes and report back on file differences.  To do so, use the
  1054. `--compare' (`-d') or `--diff' operation.
  1055.  
  1056.    The `--compare' (`-d') operation, as its name implies, causes `tar'
  1057. to compare files and directories in the archive with their counterparts
  1058. (files of the same name) in the file system, and report back
  1059. differences in file size, mode, owner and modification date.  When
  1060. performing the `--compare' (`-d') operation, `tar' acts only on files
  1061. actually in the archive--it will ignore files in the active file system
  1062. that do not exist in the archive.  If `tar' with `--compare' (`-d')
  1063. specified is given, as a file name argument, the name of a file that
  1064. does not exist in the archive, it will return an error message.
  1065.  
  1066.    To compare the files in the practice directory with their
  1067. counterparts in the archive file `records', in the same directory, you
  1068. would, while in the `practice' directory:
  1069.  
  1070.    * Invoke `tar' and specify the operation to compare files in the
  1071.      archive with their counterparts in the file system--`--compare'
  1072.      (`-d') or `--diff'.
  1073.  
  1074.    * Specify the name of the archive where the files to be compared are
  1075.      stored--`--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME').
  1076.  
  1077.    * Specify the names of the files or directories to be compared, as
  1078.      file name arguments (in this case, you are comparing all the files
  1079.      in the archive, so nothing need be specified).
  1080.  
  1081.      % tar --compare --file=records
  1082.      %
  1083.  
  1084. While it looks like nothing has happened, `tar' has, in fact, done the
  1085. comparison--and found nothing to report.  The same example with the
  1086. `--verbose' (`-v') option specified would list the files in the archive
  1087. as they are being compared with their counterparts of the same name:
  1088.  
  1089.      % tar --compare --verbose --file=records
  1090.      blues
  1091.      folk
  1092.      jazz
  1093.      %
  1094.  
  1095.    If `tar' had had anything to report, it would have done so as it was
  1096. comparing each file.  If you remove the file `jazz' from the file
  1097. system (`rm jazz'), and modify the file `blues' (for instance, by
  1098. adding text to it with a text editor), the above example would look
  1099. like:
  1100.  
  1101.      % tar --compare --verbose --file=records
  1102.      blues
  1103.      blues: mod time differs
  1104.      blues: size differs
  1105.      folk
  1106.      jazz
  1107.      jazz: does not exist
  1108.      %
  1109.  
  1110.    You should note again that while `--compare' (`-d') does cause `tar'
  1111. to report back on files in the archive that do not exist in the file
  1112. system, `tar' will ignore files in the active file system that do not
  1113. exist in the archive.  To demonstrate this, create a file in the
  1114. `practice' directory called `rock' (using any text editor).  If you
  1115. generate a directory listing the new file will appear.
  1116.  
  1117.      % ls
  1118.      blues     folk      records  rock
  1119.  
  1120. If you run the `--compare' (`-d') example again you will obtain the
  1121. following:
  1122.  
  1123.      % tar --compare --verbose --file=records
  1124.      blues
  1125.      blues: mod time differs
  1126.      blues: size differs
  1127.      folk
  1128.      jazz
  1129.      jazz: does not exist
  1130.      %
  1131.  
  1132.    `tar' ignores the file `rock' because `tar' is comparing files in
  1133. the archive to files in the file system, not vice versa.  If `rock' had
  1134. been passed to `tar' explicitly (as a file name argument), `tar' would
  1135. have returned an error message, as follows:
  1136.  
  1137.      % tar --compare --verbose --file=records rock
  1138.      tar: rock not found in archive
  1139.      %
  1140.  
  1141.    To compare the attributes of archive members with the attributes of
  1142. their counterparts in the file system, use the `--compare' (`-d') or
  1143. `--diff'operation.  While you could use `--list --verbose' (`-tv') to
  1144. manually compare some file attributes, it is simpler to have `tar'
  1145. itself compare file attributes and report back on file differences.
  1146. FIXME: "manually"?  suggestions?
  1147.  
  1148.    The `--compare' (`-d') operation, as its name implies, compares
  1149. archive members with files of the same name in the file system, and
  1150. reports back differences in file size, mode, owner and modification
  1151. date. `tar +compare' acts only on archive members-it ignores files in
  1152. the file system that are not stored in the archive.  If you give with
  1153. `--compare' (`-d') a NAME argument that does not correspond to the name
  1154. of an archive member, `tar' responds with an error message.
  1155.  
  1156.    To compare archive members in the archive file `records' with files
  1157. in the `~/practice' directory, first change into the `practice'
  1158. directory.  Then:
  1159.  
  1160.    * Invoke `tar' and specify the `--compare' (`-d')
  1161.      operation--`--compare' (`-d') or `--diff'.
  1162.  
  1163.    * Specify the archive where the files to be compared are
  1164.      stored--`--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME').
  1165.  
  1166.    * Specify the archive members to be compared.  (In this example you
  1167.      are comparing all the archive members in the archive.  Since this
  1168.      is the default, you don't need to use any file name arguments).
  1169.  
  1170.      % tar --compare --file=records
  1171.      %
  1172.  
  1173.    While it looks like nothing has happened, `tar' has, in fact, done
  1174. the comparison--and found nothing to report.
  1175.  
  1176.    Use the `--verbose' (`-v') option to list the names of archive
  1177. members as they are being compared with their counterparts of the same
  1178. name in the file system:
  1179.  
  1180.      % tar --compare --verbose --file=records
  1181.      blues
  1182.      folk
  1183.      jazz
  1184.      %
  1185.  
  1186.    If `tar' had had anything to report, it would have done so as it was
  1187. comparing each file.
  1188.  
  1189.    If you remove the file `jazz' from the file system (`rm jazz'), and
  1190. modify the file `blues' (for instance, by adding text to it with an
  1191. editor such as Emacs), the above example would look like:
  1192.  
  1193.      % tar --compare --verbose --file=records
  1194.      blues
  1195.      blues: mod time differs
  1196.      blues: size differs
  1197.      folk
  1198.      jazz
  1199.      jazz: does not exist
  1200.      %
  1201.  
  1202.    Note again that while `--compare' (`-d') reports the names of archive
  1203. members that do not have counterparts in the file system, `--compare'
  1204. (`-d') ignores files in the file system that do not have counterparts
  1205. in the archive.  To demonstrate this, create a file in the `practice'
  1206. directory called `rock' (using any text editor).  The new file appears
  1207. when you list the directory's contents:
  1208.  
  1209. FIXME: Given an example
  1210.  
  1211. 
  1212. File: tar.info,  Node: Using Compare from the Superior Directory bis,  Prev: Compare bis,  Up: How to Create Archives
  1213.  
  1214. Using Compare from the Superior Directory
  1215. -----------------------------------------
  1216.  
  1217.      *(This message will disappear, once this node revised.)*
  1218.  
  1219.    In addition to using `--compare' (`-d') to compare individual files
  1220. in an archive with their counterparts in the file system, you can use
  1221. `--compare' (`-d') to compare archived directories with their
  1222. counterparts in the active file system.  You could re-create the
  1223. examples above using your home directory as the working directory, and
  1224. using the archive file `music' (in which is stored the `practice'
  1225. directory) instead of the archive file `records'.
  1226.  
  1227.    First, change into the home directory (`cd ..').  Then, try the
  1228. above example using `music' as the specified archive file, and the
  1229. `practice' subdirectory as a file name argument.
  1230.  
  1231.      % tar --compare --verbose --file=music practice
  1232.      practice
  1233.      practice/blues
  1234.      practice/blues: mod time differs
  1235.      practice/blues: size differs
  1236.      practice/folk
  1237.      practice/jazz
  1238.      practice/jazz: does not exist
  1239.      practice/records
  1240.  
  1241.    In addition to using `--compare' (`-d') to compare text files, you
  1242. can use `--compare' (`-d') to compare directories.  To illustrate this,
  1243. re-create the examples above using your home directory as the working
  1244. directory, and using the archive file `~/music' instead of the archive
  1245. file `~/practice/records'.
  1246.  
  1247.    First, change into your home directory (`cd ~').  Then, try the
  1248. above example using `music' as the specified archive file, and
  1249. `practice' as a file name argument.
  1250.  
  1251.      % tar --compare --verbose --file=music practice
  1252.  
  1253.    If you have been following along with the tutorial, `tar' will
  1254. respond:
  1255.  
  1256.      practice
  1257.      practice/blues
  1258.      practice/blues: mod time differs
  1259.      practice/blues: size differs
  1260.      practice/folk
  1261.      practice/jazz
  1262.      practice/jazz: does not exist
  1263.      practice/records
  1264.  
  1265. 
  1266. File: tar.info,  Node: How to List Archives,  Next: How to Extract Members from an Archive,  Prev: How to Create Archives,  Up: Tutorial
  1267.  
  1268. How to List Archives
  1269. ====================
  1270.  
  1271.      *(This message will disappear, once this node revised.)*
  1272.  
  1273.    Use `--list' (`-t') to print the names of members stored in an
  1274. archive.  Use a `--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME') option just
  1275. as with `--create' (`-c') to specify the name of the archive.  For
  1276. example, the archive `afiles.tar' created in the last section could be
  1277. examined with the command `tar --list --file=afiles.tar'.  The output
  1278. of `tar' would then be:
  1279.  
  1280.      apple
  1281.      angst
  1282.      asparagus
  1283.  
  1284.    The archive `bfiles.tar' would list as follows:
  1285.  
  1286.      ./baloons
  1287.      baboon
  1288.      ./bodacious
  1289.  
  1290.    (Of course, `tar --list --file=empty-archive.tar' would produce no
  1291. output.)
  1292.  
  1293.    If you use the `--verbose' (`-v') option with `--list' (`-t'), then
  1294. `tar' will print out a listing reminiscent of `ls -l', showing owner,
  1295. file size, and so forth.
  1296.  
  1297.    You can also specify member names when using `--list' (`-t').  In
  1298. this case, `tar' will only list the names of members you identify.  For
  1299. example, `tar --list --file=afiles.tar apple' would only print `apple'.
  1300. It is essential when specifying member names to `tar' that you give
  1301. the exact member names.  For example, `tar --list --file=bfiles
  1302. baloons' would produce no output, because there is no member named
  1303. `baloons', only one named `./baloons'.  While the file names `baloons'
  1304. and `./baloons' name the same file, member names are compared using a
  1305. simplistic name comparison, in which an exact match is necessary.
  1306.  
  1307. * Menu:
  1308.  
  1309. * Listing files in an archive bis::
  1310. * Getting Additional File Information bis::
  1311. * List A Specific File in an Archive bis::
  1312. * Listing the Contents of a Stored Directory ter::
  1313.  
  1314.