@smallbook
@c %**end of header
-@c ======================================================================
-@c This document has three levels of rendition: PUBLISH, DISTRIB or PROOF,
-@c as decided by @set symbols. The PUBLISH rendition does not show
-@c notes or marks asking for revision. Most users will prefer having more
-@c information, even if this information is not fully revised for adequacy,
-@c so DISTRIB is the default for tar distributions. The PROOF rendition
-@c show all marks to the point of ugliness, but is nevertheless useful to
-@c those working on the manual itself.
-@c ======================================================================
-
-@ifclear PUBLISH
-@ifclear DISTRIB
-@ifclear PROOF
-@set DISTRIB
-@end ifclear
-@end ifclear
-@end ifclear
-
-@ifset PUBLISH
-@set RENDITION The book, version
-@end ifset
-
-@ifset DISTRIB
-@set RENDITION FTP release, version
-@end ifset
-
-@ifset PROOF
-@set RENDITION Proof reading version
-@end ifset
-
-@c ---------------------------------------------------------------------
-@c The @FIXME's, @UNREVISED and @c comments are part Fran@,{c}ois's work
-@c plan. These annotations are somewhat precious to him; he asks that I
-@c do not alter them inconsiderately. Much work is needed for GNU tar
-@c internals (the sources, the programs themselves). Revising the
-@c adequacy of the manual while revising the sources, and cleaning them
-@c both at the same time, is a good way to proceed.
-@c ---------------------------------------------------------------------
-
-@c Output marks for nodes needing revision, but not in PUBLISH rendition.
-
-@macro UNREVISED
-@ifclear PUBLISH
-@quotation
-@emph{(This message will disappear, once this node revised.)}
-@end quotation
-@end ifclear
-@end macro
-
-@c Output various FIXME information only in PROOF rendition.
-
-@macro FIXME{string}
-@allow-recursion
-@quote-arg
-@ifset PROOF
-@strong{<FIXME>} \string\ @strong{</>}
-@end ifset
-
-@end macro
-
-@macro FIXME-ref{string}
-@quote-arg
-@ifset PROOF
-@strong{<REF>} \string\ @strong{</>}
-@end ifset
-
-@end macro
-
-@macro FIXME-pxref{string}
-@quote-arg
-@ifset PROOF
-@strong{<PXREF>} \string\ @strong{</>}
-@end ifset
-
-@end macro
-
-@macro FIXME-xref{string}
-@quote-arg
-@ifset PROOF
-@strong{<XREF>} \string\ @strong{</>}
-@end ifset
-
-@end macro
-
-@c @macro option{entry}
-@c @quote-arg
-@c @opindex{--\entry\}
-@c @value{\entry\}
-@c @end macro
-
-@macro GNUTAR
-@acronym{GNU} @command{tar}
-@end macro
-
-@set op-absolute-names @kbd{--absolute-names} (@kbd{-P})
-@set ref-absolute-names @ref{absolute}
-@set xref-absolute-names @xref{absolute}
-@set pxref-absolute-names @pxref{absolute}
-
-@set op-after-date @kbd{--after-date=@var{date}} (@kbd{--newer=@var{date}}, @kbd{-N @var{date}})
-@set ref-after-date @ref{after}
-@set xref-after-date @xref{after}
-@set pxref-after-date @pxref{after}
-
-@set op-append @kbd{--append} (@kbd{-r})
-@set ref-append @ref{add}
-@set xref-append @xref{add}
-@set pxref-append @pxref{add}
-
-@set op-atime-preserve @kbd{--atime-preserve}
-@set ref-atime-preserve @ref{Attributes}
-@set xref-atime-preserve @xref{Attributes}
-@set pxref-atime-preserve @pxref{Attributes}
-
-@set op-backup @kbd{--backup}
-@set ref-backup @ref{Backup options}
-@set xref-backup @xref{Backup options}
-@set pxref-backup @pxref{Backup options}
-
-@set op-block-number @kbd{--block-number} (@kbd{-R})
-@set ref-block-number @ref{verbose}
-@set xref-block-number @xref{verbose}
-@set pxref-block-number @pxref{verbose}
-
-@set op-blocking-factor @kbd{--blocking-factor=@var{512-size}} (@kbd{-b @var{512-size}})
-@set ref-blocking-factor @ref{Blocking Factor}
-@set xref-blocking-factor @xref{Blocking Factor}
-@set pxref-blocking-factor @pxref{Blocking Factor}
-
-@set op-bzip2 @kbd{--bzip2} (@kbd{-j})
-@set ref-bzip2 @ref{gzip}
-@set xref-bzip2 @xref{gzip}
-@set pxref-bzip2 @pxref{gzip}
-
-@set op-check-links @kbd{--check-links} (@kbd{-l})
-@set ref-check-links @ref{--check-links}
-@set xref-check-links @xref{--check-links}
-@set pxref-check-links @pxref{--check-links}
-
-@set op-checkpoint @kbd{--checkpoint}
-@set ref-checkpoint @ref{verbose}
-@set xref-checkpoint @xref{verbose}
-@set pxref-checkpoint @pxref{verbose}
-
-@set op-check-links @kbd{--check-links}
-
-@set op-compare @kbd{--compare} (@kbd{--diff}, @kbd{-d})
-@set ref-compare @ref{compare}
-@set xref-compare @xref{compare}
-@set pxref-compare @pxref{compare}
-
-@set op-compress @kbd{--compress} (@kbd{--uncompress}, @kbd{-Z})
-@set ref-compress @ref{gzip}
-@set xref-compress @xref{gzip}
-@set pxref-compress @pxref{gzip}
-
-@set op-concatenate @kbd{--concatenate} (@kbd{--catenate}, @kbd{-A})
-@set ref-concatenate @ref{concatenate}
-@set xref-concatenate @xref{concatenate}
-@set pxref-concatenate @pxref{concatenate}
-
-@set op-create @kbd{--create} (@kbd{-c})
-@set ref-create @ref{create}
-@set xref-create @xref{create}
-@set pxref-create @pxref{create}
-
-@set op-delete @kbd{--delete}
-@set ref-delete @ref{delete}
-@set xref-delete @xref{delete}
-@set pxref-delete @pxref{delete}
-
-@set op-dereference @kbd{--dereference} (@kbd{-h})
-@set ref-dereference @ref{dereference}
-@set xref-dereference @xref{dereference}
-@set pxref-dereference @pxref{dereference}
-
-@set op-directory @kbd{--directory=@var{directory}} (@kbd{-C @var{directory}})
-@set ref-directory @ref{directory}
-@set xref-directory @xref{directory}
-@set pxref-directory @pxref{directory}
-
-@set op-exclude @kbd{--exclude=@var{pattern}}
-@set ref-exclude @ref{exclude}
-@set xref-exclude @xref{exclude}
-@set pxref-exclude @pxref{exclude}
-
-@set op-exclude-from @kbd{--exclude-from=@var{file-of-patterns}} (@kbd{-X @var{file-of-patterns}})
-@set ref-exclude-from @ref{exclude}
-@set xref-exclude-from @xref{exclude}
-@set pxref-exclude-from @pxref{exclude}
-
-@set op-exclude-caches @kbd{--exclude-caches}
-@set ref-exclude-from @ref{exclude-caches}
-@set xref-exclude-from @xref{exclude-caches}
-@set pxref-exclude-from @pxref{exclude-caches}
-
-@set op-extract @kbd{--extract} (@kbd{--get}, @kbd{-x})
-@set ref-extract @ref{extract}
-@set xref-extract @xref{extract}
-@set pxref-extract @pxref{extract}
-
-@set op-file @kbd{--file=@var{archive-name}} (@kbd{-f @var{archive-name}})
-@set ref-file @ref{file}
-@set xref-file @xref{file}
-@set pxref-file @pxref{file}
-
-@set op-files-from @kbd{--files-from=@var{file-of-names}} (@kbd{-T @var{file-of-names}})
-@set ref-files-from @ref{files}
-@set xref-files-from @xref{files}
-@set pxref-files-from @pxref{files}
-
-@set op-force-local @kbd{--force-local}
-@set ref-force-local @ref{file}
-@set xref-force-local @xref{file}
-@set pxref-force-local @pxref{file}
-
-@set op-group @kbd{--group=@var{group}}
-@set ref-group @ref{Option Summary}
-@set xref-group @xref{Option Summary}
-@set pxref-group @pxref{Option Summary}
-
-@set op-gzip @kbd{--gzip} (@kbd{--gunzip}, @kbd{--ungzip}, @kbd{-z})
-@set ref-gzip @ref{gzip}
-@set xref-gzip @xref{gzip}
-@set pxref-gzip @pxref{gzip}
-
-@set op-help @kbd{--help}
-@set ref-help @ref{help}
-@set xref-help @xref{help}
-@set pxref-help @pxref{help}
-
-@set op-ignore-failed-read @kbd{--ignore-failed-read}
-@set ref-ignore-failed-read @ref{create options}
-@set xref-ignore-failed-read @xref{create options}
-@set pxref-ignore-failed-read @pxref{create options}
-
-@set op-ignore-zeros @kbd{--ignore-zeros} (@kbd{-i})
-@set ref-ignore-zeros @ref{Reading}
-@set xref-ignore-zeros @xref{Reading}
-@set pxref-ignore-zeros @pxref{Reading}
-
-@set op-incremental @kbd{--incremental} (@kbd{-G})
-@set ref-incremental @ref{Inc Dumps}
-@set xref-incremental @xref{Inc Dumps}
-@set pxref-incremental @pxref{Inc Dumps}
-
-@set op-info-script @kbd{--info-script=@var{script-name}} (@kbd{--new-volume-script=@var{script-name}}, @kbd{-F @var{script-name}})
-@set ref-info-script @ref{Multi-Volume Archives}
-@set xref-info-script @xref{Multi-Volume Archives}
-@set pxref-info-script @pxref{Multi-Volume Archives}
-
-@set op-interactive @kbd{--interactive} (@kbd{-w})
-@set ref-interactive @ref{interactive}
-@set xref-interactive @xref{interactive}
-@set pxref-interactive @pxref{interactive}
-
-@set op-keep-old-files @kbd{--keep-old-files} (@kbd{-k})
-@set ref-keep-old-files @ref{Keep Old Files}
-@set xref-keep-old-files @xref{Keep Old Files}
-@set pxref-keep-old-files @pxref{Keep Old Files}
-
-@set op-keep-newer-files @kbd{--keep-old-files}
-@set ref-keep-newer-files @ref{Keep Newer Files}
-@set xref-keep-newer-files @xref{Keep Newer Files}
-@set pxref-keep-newer-files @pxref{Keep Newer Files}
-
-@set op-label @kbd{--label=@var{archive-label}} (@kbd{-V @var{archive-label}})
-@set ref-label @ref{label}
-@set xref-label @xref{label}
-@set pxref-label @pxref{label}
-
-@set op-list @kbd{--list} (@kbd{-t})
-@set ref-list @ref{list}
-@set xref-list @xref{list}
-@set pxref-list @pxref{list}
-
-@set op-listed-incremental @kbd{--listed-incremental=@var{snapshot-file}} (@kbd{-g @var{snapshot-file}})
-@set ref-listed-incremental @ref{Inc Dumps}
-@set xref-listed-incremental @xref{Inc Dumps}
-@set pxref-listed-incremental @pxref{Inc Dumps}
-
-@set op-mode @kbd{--mode=@var{permissions}}
-@set ref-mode @ref{Option Summary}
-@set xref-mode @xref{Option Summary}
-@set pxref-mode @pxref{Option Summary}
-
-@set op-multi-volume @kbd{--multi-volume} (@kbd{-M})
-@set ref-multi-volume @ref{Multi-Volume Archives}
-@set xref-multi-volume @xref{Multi-Volume Archives}
-@set pxref-multi-volume @pxref{Multi-Volume Archives}
-
-@set op-newer-mtime @kbd{--newer-mtime=@var{date}}
-@set ref-newer-mtime @ref{after}
-@set xref-newer-mtime @xref{after}
-@set pxref-newer-mtime @pxref{after}
-
-@set op-no-recursion @kbd{--no-recursion}
-@set ref-no-recursion @ref{recurse}
-@set xref-no-recursion @xref{recurse}
-@set pxref-no-recursion @pxref{recurse}
-
-@set op-no-same-owner @kbd{--no-same-owner} (@kbd{-o})
-@set ref-no-same-owner @ref{Attributes}
-@set xref-no-same-owner @xref{Attributes}
-@set pxref-no-same-owner @pxref{Attributes}
-
-@set op-no-same-permissions @kbd{--no-same-permissions}
-@set ref-no-same-permissions @ref{Attributes}
-@set xref-no-same-permissions @xref{Attributes}
-@set pxref-no-same-permissions @pxref{Attributes}
-
-@set op-null @kbd{--null}
-@set ref-null @ref{files}
-@set xref-null @xref{files}
-@set pxref-null @pxref{files}
-
-@set op-numeric-owner @kbd{--numeric-owner}
-@set ref-numeric-owner @ref{Attributes}
-@set xref-numeric-owner @xref{Attributes}
-@set pxref-numeric-owner @pxref{Attributes}
-
-@set op-occurrence @kbd{--occurrence}
-@set ref-occurrence @ref{--occurrence}
-@set xref-occurrence @xref{--occurrence}
-@set pxref-occurrence @pxref{--occurrence}
-
-@set op-old-archive @kbd{--old-archive} (@kbd{-o})
-@set ref-old-archive @ref{old}
-@set xref-old-archive @xref{old}
-@set pxref-old-archive @pxref{old}
-
-@set op-one-file-system @kbd{--one-file-system} (@kbd{-l})
-@set ref-one-file-system @ref{one}
-@set xref-one-file-system @xref{one}
-@set pxref-one-file-system @pxref{one}
-
-@set op-overwrite @kbd{--overwrite}
-@set ref-overwrite @ref{Overwrite Old Files}
-@set xref-overwrite @xref{Overwrite Old Files}
-@set pxref-overwrite @pxref{Overwrite Old Files}
-
-@set op-owner @kbd{--owner=@var{user}}
-@set ref-owner @ref{Option Summary}
-@set xref-owner @xref{Option Summary}
-@set pxref-owner @pxref{Option Summary}
-
-@set op-format @kbd{--format} (@kbd{-H})
-@set ref-format @ref{format}
-@set xref-format @xref{format}
-@set pxref-format @pxref{format}
-
-@set op-format-v7 @kbd{--format=v7}
-@set op-format-gnu @kbd{--format=gnu}
-@set op-format-oldgnu @kbd{--format=oldgnu}
-@set op-format-posix @kbd{--format=posix}
-@set op-format-ustar @kbd{--format=ustar}
-
-@set op-posix @kbd{--posix}
-@set ref-posix @ref{posix}
-@set xref-posix @xref{posix}
-@set pxref-posix @pxref{posix}
-
-@set op-preserve @kbd{--preserve}
-@set ref-preserve @ref{Attributes}
-@set xref-preserve @xref{Attributes}
-@set pxref-preserve @pxref{Attributes}
-
-@set op-record-size @kbd{--record-size=@var{size}}
-@set ref-record-size @ref{Blocking}
-@set xref-record-size @xref{Blocking}
-@set pxref-record-size @pxref{Blocking}
-
-@set op-recursive-unlink @kbd{--recursive-unlink}
-@set ref-recursive-unlink @ref{Writing}
-@set xref-recursive-unlink @xref{Writing}
-@set pxref-recursive-unlink @pxref{Writing}
-
-@set op-read-full-records @kbd{--read-full-records} (@kbd{-B})
-@set ref-read-full-records @ref{Blocking}
-@set xref-read-full-records @xref{Blocking}
-@set pxref-read-full-records @pxref{Blocking}
-@c FIXME: or should it be Reading, or Blocking Factor
-
-@set op-remove-files @kbd{--remove-files}
-@set ref-remove-files @ref{Writing}
-@set xref-remove-files @xref{Writing}
-@set pxref-remove-files @pxref{Writing}
-
-@set op-rmt-command @kbd{rmt-command=@var{command}}
-@set op-rsh-command @kbd{rsh-command=@var{command}}
-
-@set op-same-order @kbd{--same-order} (@kbd{--preserve-order}, @kbd{-s})
-@set ref-same-order @ref{Scarce}
-@set xref-same-order @xref{Scarce}
-@set pxref-same-order @pxref{Scarce}
-@c FIXME: or should it be Reading, or Attributes?
-
-@set op-same-owner @kbd{--same-owner}
-@set ref-same-owner @ref{Attributes}
-@set xref-same-owner @xref{Attributes}
-@set pxref-same-owner @pxref{Attributes}
-
-@set op-same-permissions @kbd{--same-permissions} (@kbd{--preserve-permissions}, @kbd{-p})
-@set ref-same-permissions @ref{Attributes}
-@set xref-same-permissions @xref{Attributes}
-@set pxref-same-permissions @pxref{Attributes}
-@c FIXME: or should it be Writing?
-
-@set op-show-omitted-dirs @kbd{--show-omitted-dirs}
-@set ref-show-omitted-dirs @ref{verbose}
-@set xref-show-omitted-dirs @xref{verbose}
-@set pxref-show-omitted-dirs @pxref{verbose}
-
-@set op-sparse @kbd{--sparse} (@kbd{-S})
-@set ref-sparse @ref{sparse}
-@set xref-sparse @xref{sparse}
-@set pxref-sparse @pxref{sparse}
-
-@set op-starting-file @kbd{--starting-file=@var{name}} (@kbd{-K @var{name}})
-@set ref-starting-file @ref{Scarce}
-@set xref-starting-file @xref{Scarce}
-@set pxref-starting-file @pxref{Scarce}
-
-@set op-strip-components @kbd{--strip-components}
-@set ref-strip-components @ref{--strip-components}
-@set xref-strip-components @xref{--strip-components}
-@set pxref-strip-components @pxref{--strip-components}
-
-@set op-suffix @kbd{--suffix=@var{suffix}}
-@set ref-suffix @ref{Backup options}
-@set xref-suffix @xref{Backup options}
-@set pxref-suffix @pxref{Backup options}
-
-@set op-tape-length @kbd{--tape-length=@var{1024-size}} (@kbd{-L @var{1024-size}})
-@set ref-tape-length @ref{Using Multiple Tapes}
-@set xref-tape-length @xref{Using Multiple Tapes}
-@set pxref-tape-length @pxref{Using Multiple Tapes}
-
-@set op-to-stdout @kbd{--to-stdout} (@kbd{-O})
-@set ref-to-stdout @ref{Writing}
-@set xref-to-stdout @xref{Writing}
-@set pxref-to-stdout @pxref{Writing}
-
-@set op-totals @kbd{--totals}
-@set ref-totals @ref{verbose}
-@set xref-totals @xref{verbose}
-@set pxref-totals @pxref{verbose}
-
-@set op-touch @kbd{--touch} (@kbd{-m})
-@set ref-touch @ref{Writing}
-@set xref-touch @xref{Writing}
-@set pxref-touch @pxref{Writing}
-
-@set op-unlink-first @kbd{--unlink-first} (@kbd{-U})
-@set ref-unlink-first @ref{Writing}
-@set xref-unlink-first @xref{Writing}
-@set pxref-unlink-first @pxref{Writing}
-
-@set op-update @kbd{--update} (@kbd{-u})
-@set ref-update @ref{update}
-@set xref-update @xref{update}
-@set pxref-update @pxref{update}
-
-@set op-use-compress-prog @kbd{--use-compress-prog=@var{program}}
-@set ref-use-compress-prog @ref{gzip}
-@set xref-use-compress-prog @xref{gzip}
-@set pxref-use-compress-prog @pxref{gzip}
-
-@set op-verbose @kbd{--verbose} (@kbd{-v})
-@set ref-verbose @ref{verbose}
-@set xref-verbose @xref{verbose}
-@set pxref-verbose @pxref{verbose}
-
-@set op-verify @kbd{--verify} (@kbd{-W})
-@set ref-verify @ref{verify}
-@set xref-verify @xref{verify}
-@set pxref-verify @pxref{verify}
-
-@set op-version @kbd{--version}
-@set ref-version @ref{help}
-@set xref-version @xref{help}
-@set pxref-version @pxref{help}
-
-@set op-volno-file @kbd{--volno-file=@var{file-of-number}}
-@set ref-volno-file @ref{Using Multiple Tapes}
-@set xref-volno-file @xref{Using Multiple Tapes}
-@set pxref-volno-file @pxref{Using Multiple Tapes}
-
-@set op-seek @kbd{--seek}
-@set ref-seek @ref{seek}
-@set xref-seek @xref{seek}
-@set pxref-seek @pxref{seek}
+@include rendition.texi
+@include value.texi
@c Put everything in one index (arbitrarily chosen to be the concept index).
@syncodeindex fn cp
@titlepage
@title @acronym{GNU} tar: an archiver tool
@subtitle @value{RENDITION} @value{VERSION}, @value{UPDATED}
-@author Melissa Weisshaus, Jay Fenlason,
-@author Thomas Bushnell, n/BSG, Amy Gorin
-@c he said to remove it: Fran@,{c}ois Pinard
-@c i'm thinking about how the author page *should* look. -mew 2may96
+@author John Gilmore, Jay Fenlason et al.
@page
@vskip 0pt plus 1filll
* Date input formats::
* Formats::
* Media::
+
+Appendices
+
+* Genfile::
* Free Software Needs Free Documentation::
* Copying This Manual::
* Index::
* delete::
* compare::
-How to Add Files to Existing Archives: @code{--append}
+How to Add Files to Existing Archives: @option{--append}
* appending files:: Appending Files to an Archive
* multiple::
* how to update::
-Options Used by @code{--create}
+Options Used by @option{--create}
* Ignore Failed Read::
-Options Used by @code{--extract}
+Options Used by @option{--extract}
* Reading:: Options to Help Read Archives
* Writing:: Changing How @command{tar} Writes Files
* Multi-Volume Archives:: Archives Longer than One Tape or Disk
* Tape Files:: Tape Files
+GNU tar test suite
+
+* Genfile::
+
Copying This Manual
* GNU Free Documentation License:: License for copying this manual
@item Use of short option @option{-l}
Earlier versions of @GNUTAR{} understood @option{-l} option as a
-synonym for @samp{--one-file-system}. Such usage is deprecated.
+synonym for @option{--one-file-system}. Such usage is deprecated.
For compatibility with other implementations future versions of
@GNUTAR{} will understand this option as a synonym for
@option{--check-links}.
@chapter Tutorial Introduction to @command{tar}
This chapter guides you through some basic examples of three @command{tar}
-operations: @samp{--create}, @samp{--list}, and @samp{--extract}. If
+operations: @option{--create}, @option{--list}, and @option{--extract}. If
you already know how to use some other version of @command{tar}, then you
may not need to read this chapter. This chapter omits most complicated
details about how @command{tar} works.
this chapter will cover how to use these operations in detail. We will
present the rest of the operations in the next chapter.
-@table @kbd
+@table @option
@item --create
@itemx -c
Create a new @command{tar} archive.
To understand how to run @command{tar} in the three operating modes listed
previously, you also need to understand how to use two of the options to
-@command{tar}: @samp{--file} (which takes an archive file as an argument)
-and @samp{--verbose}. (You are usually not @emph{required} to specify
+@command{tar}: @option{--file} (which takes an archive file as an argument)
+and @option{--verbose}. (You are usually not @emph{required} to specify
either of these options when you run @command{tar}, but they can be very
useful in making things more clear and helping you avoid errors.)
@end menu
@node file tutorial
-@unnumberedsubsec The @samp{--file} Option
+@unnumberedsubsec The @option{--file} Option
-@table @kbd
+@table @option
@item --file=@var{archive-name}
@itemx -f @var{archive-name}
Specify the name of an archive file.
@ref{file}.
@node verbose tutorial
-@unnumberedsubsec The @samp{--verbose} Option
+@unnumberedsubsec The @option{--verbose} Option
-@table @kbd
+@table @option
@item --verbose
@itemx -v
Show the files being worked on as @command{tar} is running.
@value{op-verbose} shows details about the results of running
@command{tar}. This can be especially useful when the results might not be
obvious. For example, if you want to see the progress of @command{tar} as
-it writes files into the archive, you can use the @samp{--verbose}
+it writes files into the archive, you can use the @option{--verbose}
option. In the beginning, you may find it useful to use
-@samp{--verbose} at all times; when you are more accustomed to
+@option{--verbose} at all times; when you are more accustomed to
@command{tar}, you will likely want to use it at certain times but not at
-others. We will use @samp{--verbose} at times to help make something
+others. We will use @option{--verbose} at times to help make something
clear, and we will give many examples both using and not using
-@samp{--verbose} to show the differences.
+@option{--verbose} to show the differences.
-Sometimes, a single instance of @samp{--verbose} on the command line
+Sometimes, a single instance of @option{--verbose} on the command line
will show a full, @samp{ls} style listing of an archive or files,
-@c FIXME: Describe the exact output format, e.g., how hard links are displayed.
-giving sizes, owners, and similar information. Other times,
-@samp{--verbose} will only show files or members that the particular
+giving sizes, owners, and similar information. @FIXME{Describe the
+exact output format, e.g., how hard links are displayed.}
+Other times, @option{--verbose} will only show files or members that the particular
operation is operating on at the time. In the latter case, you can
-use @samp{--verbose} twice in a command to get a listing such as that
+use @option{--verbose} twice in a command to get a listing such as that
in the former case. For example, instead of saying
@smallexample
@noindent
Note that you must double the hyphens properly each time.
-Later in the tutorial, we will give examples using @w{@samp{--verbose
+Later in the tutorial, we will give examples using @w{@option{--verbose
--verbose}}.
@node help tutorial
-@unnumberedsubsec Getting Help: Using the @code{--help} Option
+@unnumberedsubsec Getting Help: Using the @option{--help} Option
-@table @kbd
+@table @option
@item --help
-The @samp{--help} option to @command{tar} prints out a very brief list of
+The @option{--help} option to @command{tar} prints out a very brief list of
all operations and option available for the current version of
@command{tar} available on your system.
@end table
One of the basic operations of @command{tar} is @value{op-create}, which
you use to create a @command{tar} archive. We will explain
-@samp{--create} first because, in order to learn about the other
+@option{--create} first because, in order to learn about the other
operations, you will find it useful to have an archive available to
practice on.
@file{blues}, @file{folk}, and @file{jazz}. The archive is called
@file{collection.tar}.
-This section will proceed slowly, detailing how to use @samp{--create}
+This section will proceed slowly, detailing how to use @option{--create}
in @code{verbose} mode, and showing examples using both short and long
forms. In the rest of the tutorial, and in the examples in the next
chapter, we will proceed at a slightly quicker pace. This section
@command{tar}, to avoid errors).
Note that the part of the command which says,
-@w{@kbd{--file=collection.tar}} is considered to be @emph{one} argument.
+@w{@option{--file=collection.tar}} is considered to be @emph{one} argument.
If you substituted any other string of characters for
@kbd{collection.tar}, then that string would become the name of the
archive file you create.
into the habit of typing options in the order that makes inherent sense.
@xref{short create}, for more information on this.
-In this example, you type the command as shown above: @samp{--create}
+In this example, you type the command as shown above: @option{--create}
is the operation which creates the new archive
-(@file{collection.tar}), and @samp{--file} is the option which lets
+(@file{collection.tar}), and @option{--file} is the option which lets
you give it the name you chose. The files, @file{blues}, @file{folk},
and @file{jazz}, are now members of the archive, @file{collection.tar}
-(they are @dfn{file name arguments} to the @samp{--create} operation).
+(they are @dfn{file name arguments} to the @option{--create} operation).
@FIXME{xref here to the discussion of file name args?}Now that they are
in the archive, they are called @emph{archive members}, not files.
(@pxref{Definitions,members}).
want placed in the archive. If you do not specify any archive
members, @GNUTAR{} will complain.
-If you now list the contents of the working directory (@kbd{ls}), you will
+If you now list the contents of the working directory (@command{ls}), you will
find the archive file listed as well as the files you saw previously:
@smallexample
Use @value{op-append} instead. @xref{append}.
@node create verbose
-@subsection Running @samp{--create} with @samp{--verbose}
+@subsection Running @option{--create} with @option{--verbose}
If you include the @value{op-verbose} option on the command line,
@command{tar} will list the files it is acting on as it is working. In
@end smallexample
This example is just like the example we showed which did not use
-@samp{--verbose}, except that @command{tar} generated the remaining lines
+@option{--verbose}, except that @command{tar} generated the remaining lines
@iftex
(note the different font styles).
@end iftex
@noindent
In this case, @command{tar} will make an archive file called @file{v},
containing the files @file{blues}, @file{folk}, and @file{jazz}, because
-the @samp{v} is the closest ``file name'' to the @samp{-f} option, and
+the @samp{v} is the closest ``file name'' to the @option{-f} option, and
is thus taken to be the chosen archive file name. @command{tar} will try
to add a file called @file{collection.tar} to the @file{v} archive file;
if the file @file{collection.tar} did not already exist, @command{tar} will
report an error indicating that this file does not exist. If the file
@file{collection.tar} does already exist (e.g., from a previous command
you may have run), then @command{tar} will add this file to the archive.
-Because the @samp{-v} option did not get registered, @command{tar} will not
+Because the @option{-v} option did not get registered, @command{tar} will not
run under @samp{verbose} mode, and will not report its progress.
The end result is that you may be quite confused about what happened,
@noindent
It would be very easy to put the wrong string of characters
-immediately following the @samp{-f}, but doing that could sacrifice
+immediately following the @option{-f}, but doing that could sacrifice
valuable data.
For this reason, we recommend that you pay very careful attention to
Be sure to use a @value{op-file} option just as with @value{op-create}
to specify the name of the archive.
-If you use the @value{op-verbose} option with @samp{--list}, then
+If you use the @value{op-verbose} option with @option{--list}, then
@command{tar} will print out a listing reminiscent of @w{@samp{ls -l}},
showing owner, file size, and so forth.
-rw-rw-rw- myself user 62 1990-05-23 10:55 folk
@end smallexample
-@cindex File name arguments, using @code{--list} with
-@cindex @code{--list} with file name arguments
+@cindex listing member and file names
+@anchor{listing member and file names}
+It is important to notice that the output of @kbd{tar --list
+--verbose} does not necessarily match that produced by @kbd{tar
+--create --verbose} while creating the archive. It is because
+@GNUTAR{}, unless told explicitly not to do so, removes some directory
+prefixes from file names before storing them in the archive
+(@xref{absolute}, for more information). In other
+words, in verbose mode @GNUTAR{} shows @dfn{file names} when creating
+an archive and @dfn{member names} when listing it. Consider this
+example:
+
+@smallexample
+@group
+$ @kbd{tar cfv archive /etc/mail}
+tar: Removing leading `/' from member names
+/etc/mail/
+/etc/mail/sendmail.cf
+/etc/mail/aliases
+$ @kbd{tar tf archive}
+etc/mail/
+etc/mail/sendmail.cf
+etc/mail/aliases
+@end group
+@end smallexample
+
+@cindex @option{--show-stored-names} described
+ This default behavior can sometimes be inconvenient. You can force
+@GNUTAR{} show member names when creating archive by supplying
+@option{--show-stored-names} option.
+
+@table @option
+@item --show-stored-names
+Print member (not @emph{file}) names when creating the archive.
+@end table
+
+@cindex File name arguments, using @option{--list} with
+@cindex @option{--list} with file name arguments
You can specify one or more individual member names as arguments when
using @samp{list}. In this case, @command{tar} will only list the
names of members you identify. For example, @w{@kbd{tar --list
with @file{folk}, because @file{folk} is in the archive file
@file{collection.tar}. If you are not sure of the exact file name, try
listing all the files in the archive and searching for the one you
-expect to find; remember that if you use @samp{--list} with no file
+expect to find; remember that if you use @option{--list} with no file
names as arguments, @command{tar} will print the names of all the members
stored in the specified archive.
Extracting an archive does not modify the archive in any way; you can
extract it multiple times if you want or need to.
-Using @samp{--extract}, you can extract an entire archive, or specific
+Using @option{--extract}, you can extract an entire archive, or specific
files. The files can be directories containing other files, or not. As
with @value{op-create} and @value{op-list}, you may use the short or the
long form of the operation without affecting the performance.
name, and that directory does not exist under the working directory when
the file is extracted, @command{tar} will create the directory.
-We can demonstrate how to use @samp{--extract} to extract a directory
+We can demonstrate how to use @option{--extract} to extract a directory
file with an example. Change to the @file{practice} directory if you
weren't there, and remove the files @file{folk} and @file{jazz}. Then,
go back to the parent directory and extract the archive
can be used to specify an option containing whitespace or a backslash.
Note that @command{tar} options are case sensitive. For example, the
-options @samp{-T} and @samp{-t} are different; the first requires an
+options @option{-T} and @option{-t} are different; the first requires an
argument for stating the name of a file providing a list of @var{name}s,
while the second does not require an argument and is another way to
write @value{op-list}.
"mnemonic" with "long", or *ugh* vice versa.}
Each option has at least one long (or mnemonic) name starting with two
-dashes in a row, e.g.@: @samp{--list}. The long names are more clear than
+dashes in a row, e.g.@: @option{--list}. The long names are more clear than
their corresponding short or old names. It sometimes happens that a
single mnemonic option has many different different names which are
-synonymous, such as @samp{--compare} and @samp{--diff}. In addition,
+synonymous, such as @option{--compare} and @option{--diff}. In addition,
long option names can be given unique abbreviations. For example,
-@samp{--cre} can be used in place of @samp{--create} because there is no
+@option{--cre} can be used in place of @option{--create} because there is no
other mnemonic option which begins with @samp{cre}. (One way to find
this out is by trying it and seeing what happens; if a particular
abbreviation could represent more than one option, @command{tar} will tell
immediately following the option name. There are two ways of
specifying a mandatory argument. It can be separated from the
option name either by an equal sign, or by any amount of
-white space characters. For example, the @samp{--file} option (which
+white space characters. For example, the @option{--file} option (which
tells the name of the @command{tar} archive) is given a file such as
@file{archive.tar} as argument by using any of the following notations:
-@samp{--file=archive.tar} or @samp{--file archive.tar}.
+@option{--file=archive.tar} or @option{--file archive.tar}.
In contrast, optional arguments must always be introduced using
-an equal sign. For example, the @samp{--backup} option takes
+an equal sign. For example, the @option{--backup} option takes
an optional argument specifying backup type. It must be used
-as @samp{--backup=@var{backup-type}}.
+as @option{--backup=@var{backup-type}}.
@node Short Options
@subsection Short Option Style
Most options also have a short option name. Short options start with
-a single dash, and are followed by a single character, e.g.@: @samp{-t}
-(which is equivalent to @samp{--list}). The forms are absolutely
+a single dash, and are followed by a single character, e.g.@: @option{-t}
+(which is equivalent to @option{--list}). The forms are absolutely
identical in function; they are interchangeable.
The short option names are faster to type than long option names.
Short options which require arguments take their arguments immediately
following the option, usually separated by white space. It is also
possible to stick the argument right after the short option name, using
-no intervening space. For example, you might write @w{@samp{-f
-archive.tar}} or @samp{-farchive.tar} instead of using
-@samp{--file=archive.tar}. Both @samp{--file=@var{archive-name}} and
-@w{@samp{-f @var{archive-name}}} denote the option which indicates a
+no intervening space. For example, you might write @w{@option{-f
+archive.tar}} or @option{-farchive.tar} instead of using
+@option{--file=archive.tar}. Both @option{--file=@var{archive-name}} and
+@w{@option{-f @var{archive-name}}} denote the option which indicates a
specific archive, here named @file{archive.tar}.
Short options which take optional arguments take their arguments
@command{tar} program name and some white space; old options cannot appear
anywhere else. The letter of an old option is exactly the same letter as
the corresponding short option. For example, the old option @samp{t} is
-the same as the short option @samp{-t}, and consequently, the same as the
-mnemonic option @samp{--list}. So for example, the command @w{@samp{tar
-cv}} specifies the option @samp{-v} in addition to the operation @samp{-c}.
+the same as the short option @option{-t}, and consequently, the same as the
+mnemonic option @option{--list}. So for example, the command @w{@samp{tar
+cv}} specifies the option @option{-v} in addition to the operation @option{-c}.
@FIXME{bob suggests having an uglier example. :-) }
@end smallexample
@noindent
-Here, @samp{20} is the argument of @samp{-b} and @samp{/dev/rmt0} is
-the argument of @samp{-f}.
+Here, @samp{20} is the argument of @option{-b} and @samp{/dev/rmt0} is
+the argument of @option{-f}.
On the other hand, this old style syntax makes it difficult to match
option letters with their corresponding arguments, and is often
confusing. In the command @w{@samp{tar cvbf 20 /dev/rmt0}}, for example,
-@samp{20} is the argument for @samp{-b}, @samp{/dev/rmt0} is the
-argument for @samp{-f}, and @samp{-v} does not have a corresponding
+@samp{20} is the argument for @option{-b}, @samp{/dev/rmt0} is the
+argument for @option{-f}, and @option{-v} does not have a corresponding
argument. Even using short options like in @w{@samp{tar -c -v -b 20 -f
/dev/rmt0}} is clearer, putting all arguments next to the option they
pertain to.
user intended (judging based on the example in the previous set which
uses long options, whose intent is therefore very clear). The first
four specify that the @command{tar} archive would be a file named
-@samp{-c}, @samp{c}, @samp{carchive.tar} or @samp{archive.tarc},
+@option{-c}, @samp{c}, @samp{carchive.tar} or @samp{archive.tarc},
respectively. The first two examples also specify a single non-option,
@var{name} argument having the value @samp{archive.tar}. The last
example contains only old style option letters (repeating option
@node Operation Summary
@subsection Operations
-@table @kbd
+@table @option
@item --append
@itemx -r
@item --catenate
@itemx -A
-Same as @samp{--concatenate}. @xref{concatenate}.
+Same as @option{--concatenate}. @xref{concatenate}.
@item --compare
@itemx -d
@item --diff
@itemx -d
-Same @samp{--compare}. @xref{compare}.
+Same @option{--compare}. @xref{compare}.
@item --extract
@itemx -x
@item --get
@itemx -x
-Same as @samp{--extract}. @xref{extract}.
+Same as @option{--extract}. @xref{extract}.
@item --list
@itemx -t
@item --update
@itemx -u
-@FIXME{It was: A combination of the @samp{--compare} and
-@samp{--append} operations. This is not true and rather misleading,
+@FIXME{It was: A combination of the @option{--compare} and
+@option{--append} operations. This is not true and rather misleading,
as @value{op-compare} does a lot more than @value{op-update} for
ensuring files are identical.} Adds files to the end of the archive,
but only if they are newer than their counterparts already in the
@node Option Summary
@subsection @command{tar} Options
-@table @kbd
+@table @option
@item --absolute-names
@itemx -P
@item --after-date
-(See @samp{--newer}.) @FIXME-pxref{}
+(See @option{--newer}.) @FIXME-pxref{}
@item --anchored
An exclude pattern must match an initial subsequence of the name's components.
This option directs @command{tar} to print periodic checkpoint messages as it
reads through the archive. Its intended for when you want a visual
indication that @command{tar} is still running, but don't want to see
-@samp{--verbose} output. @FIXME-xref{}
+@option{--verbose} output. @FIXME-xref{}
@item --check-links
@itemx -l
@item --confirmation
-(See @samp{--interactive}.) @FIXME-pxref{}
+(See @option{--interactive}.) @FIXME-pxref{}
@item --dereference
@itemx -h
@item --exclude-from=@var{file}
@itemx -X @var{file}
-Similar to @samp{--exclude}, except @command{tar} will use the list of
+Similar to @option{--exclude}, except @command{tar} will use the list of
patterns in the file @var{file}. @FIXME-xref{}
@item --exclude-caches
@item --force-local
-Forces @command{tar} to interpret the filename given to @samp{--file}
+Forces @command{tar} to interpret the filename given to @option{--file}
as a local file, even if it looks like a remote tape drive name.
@FIXME-xref{}
@item --listed-incremental=@var{snapshot-file}
@itemx -g @var{snapshot-file}
-During a @samp{--create} operation, specifies that the archive that
+During a @option{--create} operation, specifies that the archive that
@command{tar} creates is a new @acronym{GNU}-format incremental
backup, using @var{snapshot-file} to determine which files to backup.
With other operations, informs @command{tar} that the archive is in
@item --newer-mtime=@var{date}
-Like @samp{--newer}, but add only files whose
-contents have changed (as opposed to just @samp{--newer}, which will
+Like @option{--newer}, but add only files whose
+contents have changed (as opposed to just @option{--newer}, which will
also back up files for which any status information has changed).
@item --no-anchored
@item --null
-When @command{tar} is using the @samp{--files-from} option, this option
-instructs @command{tar} to expect filenames terminated with @kbd{NUL}, so
+When @command{tar} is using the @option{--files-from} option, this option
+instructs @command{tar} to expect filenames terminated with @option{NUL}, so
@command{tar} can correctly work with file names that contain newlines.
@FIXME-xref{}
from @var{string} after substituting the following meta-characters:
@multitable @columnfractions .30 .70
-@item Meta-character @tab Replaced By
+@headitem Meta-character @tab Replaced By
@item %d @tab The directory name of the file, equivalent to the
result of the @command{dirname} utility on the translated pathname.
@item %f @tab The filename of the file, equivalent to the result
following character substitutions have been made:
@multitable @columnfractions .30 .70
-@item Meta-character @tab Replaced By
+@headitem Meta-character @tab Replaced By
@item %n @tab An integer that represents the
sequence number of the global extended header record in the archive,
starting at 1.
@item --preserve
-Synonymous with specifying both @samp{--preserve-permissions} and
-@samp{--same-order}. @FIXME-xref{}
+Synonymous with specifying both @option{--preserve-permissions} and
+@option{--same-order}. @FIXME-xref{}
@item --preserve-order
-(See @samp{--same-order}; @pxref{Reading}.)
+(See @option{--same-order}; @pxref{Reading}.)
@item --preserve-permissions
@itemx --same-permissions
@item --same-permissions
-(See @samp{--preserve-permissions}; @pxref{Writing}.)
+(See @option{--preserve-permissions}; @pxref{Writing}.)
@item --show-defaults
Instructs @command{tar} to mention directories its skipping over when
operating on a @command{tar} archive. @FIXME-xref{}
+@item --show-stored-names
+
+This option has effect only when used in conjunction with one of
+archive creation operations. It instructs tar to list the member names
+stored in the archive, as opposed to the actual file
+names. @xref{listing member and file names}.
+
@item --sparse
@itemx -S
Specifies the length of tapes that @command{tar} is writing as being
@w{@var{num} x 1024} bytes long. @FIXME-xref{}
+@item --test-label
+
+Reads the volume label. If an argument is specified, test whether it
+matches the volume label. @xref{--test-label option}.
+
@item --to-stdout
@itemx -O
@item --uncompress
-(See @samp{--compress}.) @FIXME-pxref{}
+(See @option{--compress}.) @FIXME-pxref{}
@item --ungzip
-(See @samp{--gzip}.) @FIXME-pxref{}
+(See @option{--gzip}.) @FIXME-pxref{}
@item --unlink-first
@itemx -U
@item --utc
Display file modification dates in @acronym{UTC}. This option implies
-@samp{--verbose}.
+@option{--verbose}.
@item --verbose
@itemx -v
@item --volno-file=@var{file}
-Used in conjunction with @samp{--multi-volume}. @command{tar} will keep track
+Used in conjunction with @option{--multi-volume}. @command{tar} will keep track
of which volume of a multi-volume archive its working in @var{file}.
@FIXME-xref{}
Here is an alphabetized list of all of the short option forms, matching
them with the equivalent long option.
-@table @kbd
+@table @option
@item -A
-@samp{--concatenate}
+@option{--concatenate}
@item -B
-@samp{--read-full-records}
+@option{--read-full-records}
@item -C
-@samp{--directory}
+@option{--directory}
@item -F
-@samp{--info-script}
+@option{--info-script}
@item -G
-@samp{--incremental}
+@option{--incremental}
@item -K
-@samp{--starting-file}
+@option{--starting-file}
@item -L
-@samp{--tape-length}
+@option{--tape-length}
@item -M
-@samp{--multi-volume}
+@option{--multi-volume}
@item -N
-@samp{--newer}
+@option{--newer}
@item -O
-@samp{--to-stdout}
+@option{--to-stdout}
@item -P
-@samp{--absolute-names}
+@option{--absolute-names}
@item -R
-@samp{--block-number}
+@option{--block-number}
@item -S
-@samp{--sparse}
+@option{--sparse}
@item -T
-@samp{--files-from}
+@option{--files-from}
@item -U
-@samp{--unlink-first}
+@option{--unlink-first}
@item -V
-@samp{--label}
+@option{--label}
@item -W
-@samp{--verify}
+@option{--verify}
@item -X
-@samp{--exclude-from}
+@option{--exclude-from}
@item -Z
-@samp{--compress}
+@option{--compress}
@item -b
-@samp{--blocking-factor}
+@option{--blocking-factor}
@item -c
-@samp{--create}
+@option{--create}
@item -d
-@samp{--compare}
+@option{--compare}
@item -f
-@samp{--file}
+@option{--file}
@item -g
-@samp{--listed-incremental}
+@option{--listed-incremental}
@item -h
-@samp{--dereference}
+@option{--dereference}
@item -i
-@samp{--ignore-zeros}
+@option{--ignore-zeros}
@item -j
-@samp{--bzip2}
+@option{--bzip2}
@item -k
-@samp{--keep-old-files}
+@option{--keep-old-files}
@item -l
-@samp{--one-file-system}. Use of this short option is deprecated. It
+@option{--one-file-system}. Use of this short option is deprecated. It
is retained for compatibility with the earlier versions of GNU
@command{tar}, and will be changed in future releases.
@item -m
-@samp{--touch}
+@option{--touch}
@item -o
-When creating --- @samp{--no-same-owner}, when extracting ---
-@samp{--portability}.
+When creating --- @option{--no-same-owner}, when extracting ---
+@option{--portability}.
The later usage is deprecated. It is retained for compatibility with
the earlier versions of @GNUTAR{}. In the future releases
-@option{-o} will be equivalent to @samp{--no-same-owner} only.
+@option{-o} will be equivalent to @option{--no-same-owner} only.
@item -p
-@samp{--preserve-permissions}
+@option{--preserve-permissions}
@item -r
-@samp{--append}
+@option{--append}
@item -s
-@samp{--same-order}
+@option{--same-order}
@item -t
-@samp{--list}
+@option{--list}
@item -u
-@samp{--update}
+@option{--update}
@item -v
-@samp{--verbose}
+@option{--verbose}
@item -w
-@samp{--interactive}
+@option{--interactive}
@item -x
-@samp{--extract}
+@option{--extract}
@item -z
-@samp{--gzip}
+@option{--gzip}
@end table
if disk or storage space is tight). You can do this by excluding
certain files automatically (@pxref{Choosing}), or by performing
an operation interactively, using the @value{op-interactive} option.
-@command{tar} also accepts @samp{--confirmation} for this option.
+@command{tar} also accepts @option{--confirmation} for this option.
When the @value{op-interactive} option is specified, before
reading, writing, or deleting files, @command{tar} first prints a message
In the last chapter, you learned about the first three operations to
@command{tar}. This chapter presents the remaining five operations to
-@command{tar}: @samp{--append}, @samp{--update}, @samp{--concatenate},
-@samp{--delete}, and @samp{--compare}.
+@command{tar}: @option{--append}, @option{--update}, @option{--concatenate},
+@option{--delete}, and @option{--compare}.
You are not likely to use these operations as frequently as those
covered in the last chapter; however, since they perform specialized
The five operations that we will cover in this chapter are:
-@table @kbd
+@table @option
@item --append
@itemx -r
Add new entries to an archive that already exists.
@end table
@node append
-@subsection How to Add Files to Existing Archives: @code{--append}
+@subsection How to Add Files to Existing Archives: @option{--append}
@UNREVISED
If you want to add files to an existing archive, you don't need to
create a new archive; you can use @value{op-append}. The archive must
-already exist in order to use @samp{--append}. (A related operation
-is the @samp{--update} operation; you can use this to add newer
+already exist in order to use @option{--append}. (A related operation
+is the @option{--update} operation; you can use this to add newer
versions of archive members to an existing archive. To learn how to
-do this with @samp{--update}, @pxref{update}.)
+do this with @option{--update}, @pxref{update}.)
If you use @value{op-append} to add a file that has the same name as an
archive member to an archive containing that archive member, then the
prefer; if you were to use @value{op-extract} to extract the archive,
only the most recently added copy of a member with the same name as four
other members would end up in the working directory. This is because
-@samp{--extract} extracts an archive in the order the members appeared
+@option{--extract} extracts an archive in the order the members appeared
in the archive; the most recently archived members will be extracted
last. Additionally, an extracted member will @emph{replace} a file of
the same name which existed in the directory already, and @command{tar}
@cindex Replacing members with other members
If you want to replace an archive member, use @value{op-delete} to
delete the member you want to remove from the archive, , and then use
-@samp{--append} to add the member you want to be in the archive. Note
+@option{--append} to add the member you want to be in the archive. Note
that you can not change the order of the archive; the most recently
added member will still appear last. In this sense, you cannot truly
``replace'' one member with another. (Replacing one member with another
The simplest way to add a file to an already existing archive is the
@value{op-append} operation, which writes specified files into the
archive whether or not they are already among the archived files.
-When you use @samp{--append}, you @emph{must} specify file name
+When you use @option{--append}, you @emph{must} specify file name
arguments, as there is no default. If you specify a file that already
exists in the archive, another copy of the file will be added to the
end of the archive. As with other operations, the member names of the
command line. The @value{op-verbose} option will print out the names
of the files as they are written into the archive.
-@samp{--append} cannot be performed on some tape drives, unfortunately,
+@option{--append} cannot be performed on some tape drives, unfortunately,
due to deficiencies in the formats those tape drives use. The archive
must be a valid @command{tar} archive, or else the results of using this
operation will be unpredictable. @xref{Media}.
-To demonstrate using @samp{--append} to add a file to an archive,
+To demonstrate using @option{--append} to add a file to an archive,
create a file called @file{rock} in the @file{practice} directory.
Make sure you are in the @file{practice} directory. Then, run the
following @command{tar} command to add @file{rock} to
You can use @value{op-append} to add copies of files which have been
updated since the archive was created. (However, we do not recommend
doing this since there is another @command{tar} option called
-@samp{--update}; @pxref{update} for more information. We describe this
-use of @samp{--append} here for the sake of completeness.) @FIXME{is
+@option{--update}; @pxref{update} for more information. We describe this
+use of @option{--append} here for the sake of completeness.) @FIXME{is
this really a good idea, to give this whole description for something
which i believe is basically a Stupid way of doing something? certain
aspects of it show ways in which tar is more broken than i'd personally
@end smallexample
@noindent
-Because you specified the @samp{--verbose} option, @command{tar} has
+Because you specified the @option{--verbose} option, @command{tar} has
printed the name of the file being appended as it was acted on. Now
list the contents of the archive:
In the previous section, you learned how to use @value{op-append} to add
a file to an existing archive. A related operation is
-@value{op-update}. The @samp{--update} operation updates a @command{tar}
+@value{op-update}. The @option{--update} operation updates a @command{tar}
archive by comparing the date of the specified archive members against
the date of the file with the same name. If the file has been modified
more recently than the archive member, then the newer version of the
file is added to the archive (as with @value{op-append}).
-Unfortunately, you cannot use @samp{--update} with magnetic tape drives.
+Unfortunately, you cannot use @option{--update} with magnetic tape drives.
The operation will fail.
@FIXME{other examples of media on which --update will fail? need to ask
charles and/or mib/thomas/dave shevett..}
-Both @samp{--update} and @samp{--append} work by adding to the end
+Both @option{--update} and @option{--append} work by adding to the end
of the archive. When you extract a file from the archive, only the
version stored last will wind up in the file system, unless you use
the @value{op-backup} option. @FIXME-ref{Multiple Members with the
@end menu
@node how to update
-@subsubsection How to Update an Archive Using @code{--update}
+@subsubsection How to Update an Archive Using @option{--update}
You must use file name arguments with the @value{op-update} operation.
If you don't specify any files, @command{tar} won't act on any files and
@FIXME{note: the above parenthetical added because in fact, this
behavior just confused the author. :-) }
-To see the @samp{--update} option at work, create a new file,
+To see the @option{--update} option at work, create a new file,
@file{classical}, in your practice directory, and some extra text to the
file @file{blues}, using any text editor. Then invoke @command{tar} with
the @samp{update} operation and the @value{op-verbose} option specified,
efficient. If you need to run backups, please consult @ref{Backups}.
@node concatenate
-@subsection Combining Archives with @code{--concatenate}
+@subsection Combining Archives with @option{--concatenate}
@cindex Adding archives to an archive
@cindex Concatenating Archives
one or more archives to the end of another archive, you should use the
@value{op-concatenate} operation.
-To use @samp{--concatenate}, name the archives to be concatenated on the
+To use @option{--concatenate}, name the archives to be concatenated on the
command line. (Nothing happens if you don't list any.) The members,
and their member names, will be copied verbatim from those archives. If
this causes multiple members to have the same name, it does not delete
information on how this affects reading the archive, Multiple
Members with the Same Name.}
-To demonstrate how @samp{--concatenate} works, create two small archives
+To demonstrate how @option{--concatenate} works, create two small archives
called @file{bluesrock.tar} and @file{folkjazz.tar}, using the relevant
files from @file{practice}:
folk
@end smallexample
-When you use @samp{--concatenate}, the source and target archives must
+When you use @option{--concatenate}, the source and target archives must
already exist and must have been created using compatible format
parameters. @FIXME-pxref{Matching Format Parameters}The new,
concatenated archive will be called by the same name as the first
@cindex @code{concatenate} vs @command{cat}
@cindex @command{cat} vs @code{concatenate}
It may seem more intuitive to you to want or try to use @command{cat} to
-concatenate two archives instead of using the @samp{--concatenate}
+concatenate two archives instead of using the @option{--concatenate}
operation; after all, @command{cat} is the utility for combining files.
However, @command{tar} archives incorporate an end-of-file marker which
must be removed if the concatenated archives are to be read properly as
-one archive. @samp{--concatenate} removes the end-of-archive marker
+one archive. @option{--concatenate} removes the end-of-archive marker
from the target archive before each new archive is appended. If you use
@command{cat} to combine the archives, the result will not be a valid
@command{tar} format archive. If you need to retrieve files from an
default archive name.
@node delete
-@subsection Removing Archive Members Using @samp{--delete}
+@subsection Removing Archive Members Using @option{--delete}
@UNREVISED
@cindex Deleting files from an archive
@cindex Removing files from an archive
names, nothing will be deleted. The @value{op-verbose} option will
cause @command{tar} to print the names of the members as they are deleted.
As with @value{op-extract}, you must give the exact member names when
-using @samp{tar --delete}. @samp{--delete} will remove all versions of
-the named file from the archive. The @samp{--delete} operation can run
+using @samp{tar --delete}. @option{--delete} will remove all versions of
+the named file from the archive. The @option{--delete} operation can run
very slowly.
-Unlike other operations, @samp{--delete} has no short form.
+Unlike other operations, @option{--delete} has no short form.
-@cindex Tapes, using @code{--delete} and
+@cindex Tapes, using @option{--delete} and
@cindex Deleting from tape archives
This operation will rewrite the archive. You can only use
-@samp{--delete} on an archive if the archive device allows you to
+@option{--delete} on an archive if the archive device allows you to
write to any point on the media, such as a disk; because of this, it
does not work on magnetic tapes. Do not try to delete an archive member
from a magnetic tape; the action will not succeed, and you will be
@cindex Verifying the currency of an archive
@UNREVISED
-The @samp{--compare} (@samp{-d}), or @samp{--diff} operation compares
+The @option{--compare} (@option{-d}), or @option{--diff} operation compares
specified archive members against files with the same names, and then
reports differences in file size, mode, owner, modification date and
contents. You should @emph{only} specify archive member names, not file
the integrity of the archive media. For this later goal, @xref{verify}.
@node create options
-@section Options Used by @code{--create}
+@section Options Used by @option{--create}
The previous chapter described the basics of how to use
@value{op-create} to create an archive from a set of files.
@xref{create}. This section described advanced options to be used with
-@samp{--create}.
+@option{--create}.
@menu
* Ignore Failed Read::
@node Ignore Failed Read
@subsection Ignore Fail Read
-@table @kbd
+@table @option
@item --ignore-failed-read
Do not exit with nonzero on unreadable files or directories.
@end table
@node extract options
-@section Options Used by @code{--extract}
+@section Options Used by @option{--extract}
@UNREVISED
@FIXME{i need to get dan to go over these options with me and see if
an archive into the filesystem. Various options cause @command{tar} to
extract more information than just file contents, such as the owner,
the permissions, the modification date, and so forth. This section
-presents options to be used with @samp{--extract} when certain special
+presents options to be used with @option{--extract} when certain special
considerations arise. You may review the information presented in
@ref{extract} for more basic information about the
-@samp{--extract} operation.
+@option{--extract} operation.
@menu
* Reading:: Options to Help Read Archives
@FIXME{need sentence or so of intro here}
-@table @kbd
+@table @option
@item --read-full-records
@item -B
Use in conjunction with @value{op-extract} to read an archive which
does not write after the end of an archive, but seeks to
maintain compatiblity among archiving utilities.
-@table @kbd
+@table @option
@item --ignore-zeros
@itemx -i
To ignore blocks of zeros (ie.@: end-of-archive entries) which may be
@node Overwrite Old Files
@unnumberedsubsubsec Overwrite Old Files
-@table @kbd
+@table @option
@item --overwrite
Overwrite existing files and directory metadata when extracting files
from an archive.
@node Keep Old Files
@unnumberedsubsubsec Keep Old Files
-@table @kbd
+@table @option
@item --keep-old-files
@itemx -k
Do not replace existing files from archive. The
@node Keep Newer Files
@unnumberedsubsubsec Keep Newer Files
-@table @kbd
+@table @option
@item --keep-newer-files
Do not replace existing files that are newer than their archive
copies. This option is meaningless with @value{op-list}.
@node Unlink First
@unnumberedsubsubsec Unlink First
-@table @kbd
+@table @option
@item --unlink-first
@itemx -U
Remove files before extracting over them.
@node Recursive Unlink
@unnumberedsubsubsec Recursive Unlink
-@table @kbd
+@table @option
@item --recursive-unlink
When this option is specified, try removing files and directory hierarchies
before extracting over them. @emph{This is a dangerous option!}
the files were extracted, use the @value{op-touch} option in
conjunction with @value{op-extract}.
-@table @kbd
+@table @option
@item --touch
@itemx -m
Sets the modification time of extracted archive members to the time
@unnumberedsubsubsec Setting Access Permissions
To set the modes (access permissions) of extracted files to those
-recorded for those files in the archive, use @samp{--same-permissions}
+recorded for those files in the archive, use @option{--same-permissions}
in conjunction with the @value{op-extract} operation. @FIXME{Should be
aliased to ignore-umask.}
-@table @kbd
+@table @option
@item --preserve-permission
@itemx --same-permission
@itemx --ignore-umask
they appear on standard output concatenated, in the order they are
found in the archive.
-@table @kbd
+@table @option
@item --to-stdout
@itemx -O
Writes files to the standard output. Used in conjunction with
option goes in this section. i have no idea; i only know it's nowhere
else in the book...}
-@table @kbd
+@table @option
@item --remove-files
Remove files after adding them to the archive.
@end table
@node Starting File
@unnumberedsubsubsec Starting File
-@table @kbd
+@table @option
@item --starting-file=@var{name}
@itemx -K @var{name}
Starts an operation in the middle of an archive. Use in conjunction
@node Same Order
@unnumberedsubsubsec Same Order
-@table @kbd
+@table @option
@item --same-order
@itemx --preserve-order
@itemx -s
@opindex --suffix
@cindex backup suffix
@vindex SIMPLE_BACKUP_SUFFIX
-Append @var{suffix} to each backup file made with @samp{--backup}. If this
+Append @var{suffix} to each backup file made with @option{--backup}. If this
option is not specified, the value of the @env{SIMPLE_BACKUP_SUFFIX}
environment variable is used. And if @env{SIMPLE_BACKUP_SUFFIX} is not
set, the default is @samp{~}, just as in Emacs.
Incremental dumps depend crucially on time stamps, so the results are
unreliable if you modify a file's time stamps during dumping (e.g.@:
-with the @samp{--atime-preserve} option), or if you set the clock
+with the @option{--atime-preserve} option), or if you set the clock
backwards.
Despite it should be obvious that a device has a non-volatile value, NFS
@end defvr
@defvr {Backup variable} TAPE_FILE
-The device @command{tar} writes the archive to. This device should be
-attached to the host on which the dump scripts are run.
+
+The device @command{tar} writes the archive to. If @var{TAPE_FILE}
+is a remote archive (@pxref{remote-dev}), backup script will suppose
+that your @command{mt} is able to access remote devices. If @var{RSH}
+(@pxref{RSH}) is set, @option{--rsh-command} option will be added to
+invocations of @command{mt}.
@end defvr
@defvr {Backup variable} BLOCKING
or restore. By default it is @file{/etc/backup/files}.
@end defvr
-@defvr {Backup variable} RSH
+@defvr {Backup variable} MT
+
+Full file name of @command{mt} binary.
+@end defvr
-Path to @code{rsh} binary or its equivalent. You may wish to
+@defvr {Backup variable} RSH
+@anchor{RSH}
+Full file name of @command{rsh} binary or its equivalent. You may wish to
set it to @code{ssh}, to improve security. In this case you will have
to use public key authentication.
@end defvr
@defvr {Backup variable} RSH_COMMAND
-Path to rsh binary on remote mashines. This will be passed via
-@option{--rsh-command} option to the remote invocation of @GNUTAR{}.
+Full file name of @command{rsh} binary on remote mashines. This will
+be passed via @option{--rsh-command} option to the remote invocation
+of @GNUTAR{}.
@end defvr
@defvr {Backup variable} VOLNO_FILE
@defvr {Backup variable} TAR
-Pathname of the @GNUTAR{} executable. If this is not set, backup
+Full file name of the @GNUTAR{} executable. If this is not set, backup
scripts will search @command{tar} in the current shell path.
@end defvr
option allows you to either specify or name a file to use as the archive
instead of the default archive file location.
-@table @kbd
+@table @option
@item --file=@var{archive-name}
@itemx -f @var{archive-name}
Name the archive to create or operate on. Use in conjunction with
@noindent
@file{collection.tar} is the name of the archive. It must directly
-follow the @samp{-f} option, since whatever directly follows @samp{-f}
+follow the @option{-f} option, since whatever directly follows @option{-f}
@emph{will} end up naming the archive. If you neglect to specify an
archive name, you may end up overwriting a file in the working directory
with the archive you create since @command{tar} will use this file's name
@cindex Standard input and output
@cindex tar to standard input and output
+@anchor{remote-dev}
To specify an archive file on a device attached to a remote machine,
use the following:
@noindent
@command{tar} will complete the remote connection, if possible, and
prompt you for a username and password. If you use
-@samp{--file=@@@var{hostname}:/@var{dev}/@var{file name}}, @command{tar}
+@option{--file=@@@var{hostname}:/@var{dev}/@var{file name}}, @command{tar}
will complete the remote connection, if possible, using your username
as the username on the remote machine.
@kbd{tar} @var{operation} [@var{option1} @var{option2} @dots{}] [@var{file name-1} @var{file name-2} @dots{}]
@end smallexample
+If a file name begins with dash (@samp{-}), preceede it with
+@option{--add-file} option to preventit from being treated as an
+option.
+
If you specify a directory name as a file name argument, all the files
in that directory are operated on by @command{tar}.
@node files
@section Reading Names from a File
-@UNREVISED
@cindex Reading file names from a file
@cindex Lists of file names
line, you can put the names into a file, and then use the
@value{op-files-from} option to @command{tar}. Give the name of the file
which contains the list of files to include as the argument to
-@samp{--files-from}. In the list, the file names should be separated by
-newlines. You will frequently use this option when you have generated
+@option{--files-from}. In the list, the file names should be separated by
+newlines. You will frequently use this option when you have generated
the list of files to archive with the @command{find} utility.
-@table @kbd
+@table @option
@item --files-from=@var{file name}
@itemx -T @var{file name}
Get names to extract or create from file @var{file name}.
@end table
-If you give a single dash as a file name for @samp{--files-from}, (i.e.,
-you specify either @samp{--files-from=-} or @samp{-T -}), then the file
+If you give a single dash as a file name for @option{--files-from}, (i.e.,
+you specify either @code{--files-from=-} or @code{-T -}), then the file
names are read from standard input.
-Unless you are running @command{tar} with @samp{--create}, you can not use
-both @samp{--files-from=-} and @samp{--file=-} (@samp{-f -}) in the same
+Unless you are running @command{tar} with @option{--create}, you can not use
+both @code{--files-from=-} and @code{--file=-} (@code{-f -}) in the same
command.
+Any number of @option{-T} options can be given in the command line.
+
@FIXME{add bob's example, from his message on 2-10-97}
The following example shows how to use @command{find} to generate a list of
files smaller than 400K in length and put that list into a file
-called @file{small-files}. You can then use the @samp{-T} option to
+called @file{small-files}. You can then use the @option{-T} option to
@command{tar} to specify the files from that file, @file{small-files}, to
-create the archive @file{little.tgz}. (The @samp{-z} option to
+create the archive @file{little.tgz}. (The @option{-z} option to
@command{tar} compresses the archive with @command{gzip}; @pxref{gzip} for
more information.)
@end smallexample
@noindent
-@FIXME{say more here to conclude the example/section?}
+In the file list given by @option{-T} option, any file name beginning
+with @samp{-} character is considered a @command{tar} option and is
+processed accordingly.@footnote{Versions of @GNUTAR{} up to 1.15.1
+recognized only @option{-C} option in file lists, and only if the
+option and its argument occupied two consecutive lines.} For example,
+the common use of this feature is to change to another directory by
+specifying @option{-C} option:
+
+@smallexample
+@group
+$ @kbd{cat list}
+-C/etc
+passwd
+hosts
+-C/lib
+libc.a
+$ @kbd{tar -c -f foo.tar --files-from list}
+@end group
+@end smallexample
+
+@noindent
+In this example, @command{tar} will first switch to @file{/etc}
+directory and add files @file{passwd} and @file{hosts} to the
+archive. Then it will change to @file{/lib} directory and will archive
+the file @file{libc.a}. Thus, the resulting archive @file{foo.tar} will
+contain:
+
+@smallexample
+@group
+$ @kbd{tar tf foo.tar}
+passwd
+hosts
+libc.a
+@end group
+@end smallexample
+
+@noindent
+Notice that the option parsing algorithm used with @option{-T} is
+stricter than the one used by shell. Namely, when specifying option
+arguments, you should observe the following rules:
+
+@itemize @bullet
+@item
+When using short (single-letter) option form, its argument must
+immediately follow the option letter, without any intervening
+whitespace. For example: @code{-Cdir}.
+
+@item
+When using long option form, the option argument must be separated
+from the option by a single equal sign. No whitespace is allowed on
+any side of the equal sign. For example: @code{--directory=dir}.
+
+@item
+For both short and long option forms, the option argument can be given
+on the next line after the option name, e.g.:
+
+@smallexample
+@group
+--directory
+dir
+@end group
+@end smallexample
+
+@noindent
+and
+
+@smallexample
+@group
+-C
+dir
+@end group
+@end smallexample
+@end itemize
+
+@cindex @option{--add-file}
+If you happen to have a file whose name starts with @samp{-},
+precede it with @option{--add-file} option to prevent it from
+being recognized as an option. For example: @code{--add-file --my-file}.
@menu
* nul::
@end menu
@node nul
-@subsection @kbd{NUL} Terminated File Names
+@subsection @code{NUL} Terminated File Names
-@cindex File names, terminated by @kbd{NUL}
-@cindex @kbd{NUL} terminated file names
+@cindex File names, terminated by @code{NUL}
+@cindex @code{NUL} terminated file names
The @value{op-null} option causes @value{op-files-from} to read file
names terminated by a @code{NUL} instead of a newline, so files whose
-names contain newlines can be archived using @samp{--files-from}.
+names contain newlines can be archived using @option{--files-from}.
-@table @kbd
+@table @option
@item --null
-Only consider @kbd{NUL} terminated file names, instead of files that
+Only consider @code{NUL} terminated file names, instead of files that
terminate in a newline.
@end table
-The @samp{--null} option is just like the one in @acronym{GNU}
+The @value{op-null} option is just like the one in @acronym{GNU}
@command{xargs} and @command{cpio}, and is useful with the
-@samp{-print0} predicate of @acronym{GNU} @command{find}. In
-@command{tar}, @samp{--null} also causes @value{op-directory} options
-to be treated as file names to archive, in case there are any files
-out there called @file{-C}.
+@option{-print0} predicate of @acronym{GNU} @command{find}. In
+@command{tar}, @value{op-null} also disables special handling for
+file names that begin with dash.
This example shows how to use @command{find} to generate a list of files
larger than 800K in length and put that list into a file called
-@file{long-files}. The @samp{-print0} option to @command{find} just just
-like @samp{-print}, except that it separates files with a @kbd{NUL}
+@file{long-files}. The @option{-print0} option to @command{find} is just
+like @option{-print}, except that it separates files with a @code{NUL}
rather than with a newline. You can then run @command{tar} with both the
-@samp{--null} and @samp{-T} options to specify that @command{tar} get the
+@option{--null} and @option{-T} options to specify that @command{tar} get the
files from that file, @file{long-files}, to create the archive
-@file{big.tgz}. The @samp{--null} option to @command{tar} will cause
-@command{tar} to recognize the @kbd{NUL} separator between files.
+@file{big.tgz}. The @option{--null} option to @command{tar} will cause
+@command{tar} to recognize the @code{NUL} separator between files.
@smallexample
$ @kbd{find . -size +800 -print0 > long-files}
To avoid operating on files whose names match a particular pattern,
use the @value{op-exclude} or @value{op-exclude-from} options.
-@table @kbd
+@table @option
@item --exclude=@var{pattern}
Causes @command{tar} to ignore files that match the @var{pattern}.
@end table
@file{src} except for files whose names end in @file{.o}, use the
command @samp{tar -cf src.tar --exclude='*.o' src}.
-You may give multiple @samp{--exclude} options.
+You may give multiple @option{--exclude} options.
-@table @kbd
+@table @option
@item --exclude-from=@var{file}
@itemx -X @var{file}
Causes @command{tar} to ignore files that match the patterns listed in
@end table
@findex exclude-from
-Use the @samp{--exclude-from=@var{file-of-patterns}} option to read a
+Use the @option{--exclude-from=@var{file-of-patterns}} option to read a
list of patterns, one per line, from @var{file}; @command{tar} will
ignore files matching those patterns. Thus if @command{tar} is
called as @w{@samp{tar -c -X foo .}} and the file @file{foo} contains a
@FIXME{do the exclude options files need to have stuff separated by
newlines the same as the files-from option does?}
-@table @kbd
+@table @option
@item --exclude-caches
Causes @command{tar} to ignore directories containing a cache directory tag.
@end table
@findex exclude-caches
When creating an archive,
-the @samp{--exclude-caches} option
+the @option{--exclude-caches} option
causes @command{tar} to exclude all directories
that contain a @dfn{cache directory tag}.
A cache directory tag is a short file
You can sometimes confuse the meanings of @value{op-exclude} and
@value{op-exclude-from}. Be careful: use @value{op-exclude} when files
to be excluded are given as a pattern on the command line. Use
-@samp{--exclude-from=@var{file-of-patterns}} to introduce the name of a
+@option{--exclude-from=@var{file-of-patterns}} to introduce the name of a
file which contains a list of patterns, one per line; each of these
patterns can exclude zero, one, or many files.
@item
In earlier versions of @command{tar}, what is now the
-@samp{--exclude-from=@var{file-of-patterns}} option was called
-@samp{--exclude=@var{pattern}} instead. Now,
-@samp{--exclude=@var{pattern}} applies to patterns listed on the command
-line and @samp{--exclude-from=@var{file-of-patterns}} applies to
+@option{--exclude-from=@var{file-of-patterns}} option was called
+@option{--exclude=@var{pattern}} instead. Now,
+@option{--exclude=@var{pattern}} applies to patterns listed on the command
+line and @option{--exclude-from=@var{file-of-patterns}} applies to
patterns listed in a file.
@end itemize
given. If @var{date} starts with @samp{/} or @samp{.}, it is taken to
be a file name; the last-modified time of that file is used as the date.
If you use this option when creating or appending to an archive,
-the archive will only include new files. If you use @samp{--after-date}
+the archive will only include new files. If you use @option{--after-date}
when extracting an archive, @command{tar} will only extract files newer
than the @var{date} you specify.
specify a particular date against which @command{tar} can compare when
deciding whether or not to archive the files.
-@table @kbd
+@table @option
@item --after-date=@var{date}
@itemx --newer=@var{date}
@itemx -N @var{date}
want @command{tar} to act this way.
The @value{op-no-recursion} option inhibits @command{tar}'s recursive descent
-into specified directories. If you specify @samp{--no-recursion}, you can
+into specified directories. If you specify @option{--no-recursion}, you can
use the @command{find} utility for hunting through levels of directories to
construct a list of file names which you could then pass to @command{tar}.
@command{find} allows you to be more selective when choosing which files to
archive; see @ref{files} for more information on using @command{find} with
@command{tar}, or look.
-@table @kbd
+@table @option
@item --no-recursion
Prevents @command{tar} from recursively descending directories.
This is the default.
@end table
-When you use @samp{--no-recursion}, @GNUTAR{} grabs
+When you use @option{--no-recursion}, @GNUTAR{} grabs
directory entries themselves, but does not descend on them
recursively. Many people use @command{find} for locating files they
want to back up, and since @command{tar} @emph{usually} recursively
@command{tar} will still archive files explicitly named on the command line
or through @value{op-files-from}, regardless of where they reside.
-@table @kbd
+@table @option
@item --one-file-system
@itemx -l
Prevents @command{tar} from crossing file system boundaries when
archiving. Use in conjunction with any write operation.
@end table
-The @samp{--one-file-system} option causes @command{tar} to modify its
+The @option{--one-file-system} option causes @command{tar} to modify its
normal behavior in archiving the contents of directories. If a file in
a directory is not on the same filesystem as the directory itself, then
@command{tar} will not archive that file. If the file is a directory
working directory to the directory @var{directory} after that point in
the list.
-@table @kbd
+@table @option
@item --directory=@var{directory}
@itemx -C @var{directory}
Changes the working directory in the middle of a command line.
@samp{tar --extract}, the third file will be written in a subdirectory
named @file{orange-colored}.
-You can use the @samp{--directory} option to make the archive
+You can use the @option{--directory} option to make the archive
independent of the original name of the directory holding the files.
The following command places the files @file{/etc/passwd},
@file{/etc/hosts}, and @file{/lib/libc.a} into the archive
They will not appear to be related by file name to the original
directories where those files were located.
-Note that @samp{--directory} options are interpreted consecutively. If
-@samp{--directory} specifies a relative file name, it is interpreted
+Note that @option{--directory} options are interpreted consecutively. If
+@option{--directory} specifies a relative file name, it is interpreted
relative to the then current directory, which might not be the same as
the original current working directory of @command{tar}, due to a previous
-@samp{--directory} option.
+@option{--directory} option.
+
+When using @option{--files-from} (@pxref{files}), you can put various
+@command{tar} options (including @option{-C}) in the file list. Notice,
+however, that in this case the option and its argument may not be
+separated by whitespace. If you use short option, its argument must
+either follow the option letter immediately, without any intervening
+whitespace, or occupy the next line. Otherwise, if you use long
+option, separate its argument by an equal sign.
-When using @samp{--files-from} (@pxref{files}), you can put @samp{-C}
-options in the file list. Notice, however, that in this case the
-option and its argument must occupy two consecutive lines. For
-instance, the file list for the above example will be:
+For instance, the file list for the above example will be:
@smallexample
@group
@subsection Absolute File Names
@UNREVISED
-@table @kbd
+@table @option
@item -P
@itemx --absolute-names
Do not strip leading slashes from file names, and permit file names
leading slashes from member names when putting members into the
archive. For example, if you ask @command{tar} to add the file
@file{/bin/ls} to an archive, it will do so, but the member name will
-be @file{bin/ls}.
+be @file{bin/ls}.@footnote{A side effect of this is that when
+@option{--create} is used with @option{--verbose} the resulting output
+is not, generally speaking, the same as the one you'd get running
+@kbd{tar --list} command. This may be important if you use some
+scripts for comparing both outputs. @xref{listing member and file names},
+for the information on how to handle this case.}
If you use the @value{op-absolute-names} option, @command{tar} will do
none of these transformations.
@FIXME{Is write access an issue?}
-@table @kbd
+@table @option
@item --absolute-names
Preserves full file names (including superior directory names) when
archiving files. Preserves leading slash when extracting files.
formats:
@multitable @columnfractions .10 .20 .20 .20 .20
-@item Format @tab UID @tab File Size @tab Path Name @tab Devn
+@headitem Format @tab UID @tab File Size @tab Path Name @tab Devn
@item gnu @tab 1.8e19 @tab Unlimited @tab Unlimited @tab 63
@item oldgnu @tab 1.8e19 @tab Unlimited @tab Unlimited @tab 63
@item v7 @tab 2097151 @tab 8GB @tab 99 @tab n/a
archive in V7 format (not ANSI), which can be read by these old
versions, specify the @value{op-format-v7} option in
conjunction with the @value{op-create} (@command{tar} also
-accepts @samp{--portability} or @samp{op-old-archive} for this
+accepts @option{--portability} or @samp{op-old-archive} for this
option). When you specify it,
@command{tar} leaves out information about directories, pipes, fifos,
contiguous files, and device files, and specifies file ownership by
@cindex Storing archives in compressed format
@GNUTAR{} is able to create and read compressed archives. It supports
-@command{gzip} and @command{bzip2} compression programms. For backward
+@command{gzip} and @command{bzip2} compression programs. For backward
compatibilty, it also supports @command{compress} command, although
we strongly recommend against using it, since there is a patent
covering the algorithm it uses and you could be sued for patent
The following table summarizes compression options used by @GNUTAR{}.
-@table @kbd
+@table @option
@item -z
@itemx --gzip
@itemx --ungzip
Filter the archive through @command{gzip}.
-You can use @samp{--gzip} and @samp{--gunzip} on physical devices
+You can use @option{--gzip} and @option{--gunzip} on physical devices
(tape drives, etc.) and remote files as well as on normal files; data
to or from such devices or remote files is reblocked by another copy
of the @command{tar} program to enforce the specified (or default) record
Isn't that exactly the role of the @value{op-use-compress-prog} option?
I never tried it myself, but I suspect you may want to write a
@var{prog} script or program able to filter stdin to stdout to
-way you want. It should recognize the @samp{-d} option, for when
+way you want. It should recognize the @option{-d} option, for when
extraction is needed rather than creation.
It has been reported that if one writes compressed data (through the
@cindex Sparse Files
@UNREVISED
-@table @kbd
+@table @option
@item -S
@itemx --sparse
Handle sparse files efficiently.
@command{tar} ignores the @value{op-sparse} option when reading an archive.
-@table @kbd
+@table @option
@item --sparse
@itemx -S
Files stored sparsely in the file system are represented sparsely in
Handling of file attributes
-@table @kbd
+@table @option
@item --atime-preserve
Preserve access times on files that are read.
This doesn't work for files that
@section Device Selection and Switching
@UNREVISED
-@table @kbd
+@table @option
@item -f [@var{hostname}:]@var{file}
@itemx --file=[@var{hostname}:]@var{file}
Use archive file or device @var{file} on @var{hostname}.
If the file name contains a @samp{:}, it is interpreted as
@samp{hostname:file name}. If the @var{hostname} contains an @dfn{at}
-sign (@kbd{@@}), it is treated as @samp{user@@hostname:file name}. In
+sign (@samp{@@}), it is treated as @samp{user@@hostname:file name}. In
either case, @command{tar} will invoke the command @command{rsh} (or
@command{remsh}) to start up an @command{/usr/libexec/rmt} on the remote
machine. If you give an alternate login name, it will be given to the
too. The installer could also check for @samp{DEFTAPE} in
@file{<sys/mtio.h>}.
-@table @kbd
+@table @option
@item --force-local
Archive file is local even if it contains a colon.
@xref{list}, for more information on the @value{op-list}
operation. @xref{Reading}, for a more detailed explanation of that option.
-@table @kbd
+@table @option
@item --blocking-factor=@var{number}
@itemx -b @var{number}
Specifies the blocking factor of an archive. Can be used with any
Device blocking
-@table @kbd
+@table @option
@item -b @var{blocks}
@itemx --blocking-factor=@var{blocks}
Set record size to @math{@var{blocks} * 512} bytes.
drive unit that will be used to create the archives) sometimes lowers
the error rates observed at rewriting time.
-I might also use @samp{--number-blocks} instead of
-@samp{--block-number}, so @samp{--block} will then expand to
-@samp{--blocking-factor} unambiguously.
+I might also use @option{--number-blocks} instead of
+@option{--block-number}, so @option{--block} will then expand to
+@option{--blocking-factor} unambiguously.
@node Many
@section Many Archives on One Tape
@FIXME{is there any use for record operations?}
-@table @kbd
+@table @option
@item eof
@itemx weof
Writes @var{number} tape marks at the current position on the tape.
successful, 1 if the command was unrecognized, and 2 if an operation
failed.
-@FIXME{New node on how to find an archive?}
-
-If you use @value{op-extract} with the @value{op-label} option specified,
-@command{tar} will read an archive label (the tape head has to be positioned
-on it) and print an error if the archive label doesn't match the
-@var{archive-name} specified. @var{archive-name} can be any regular
-expression. If the labels match, @command{tar} extracts the archive.
-@value{xref-label}.
-@FIXME-xref{Matching Format Parameters}@FIXME{fix cross
-references}@samp{tar --list --label} will cause @command{tar} to print the
-label.
-
-@FIXME{Program to list all the labels on a tape?}
-
@node Using Multiple Tapes
@section Using Multiple Tapes
@UNREVISED
archive, complete in itself. For example, you can list or extract any
volume alone; just don't specify @value{op-multi-volume}. However, if one
file in the archive is split across volumes, the only way to extract
-it successfully is with a multi-volume extract command @samp{--extract
---multi-volume} (@samp{-xM}) starting on or before the volume where
+it successfully is with a multi-volume extract command @option{--extract
+--multi-volume} (@option{-xM}) starting on or before the volume where
the file begins.
For example, let's presume someone has two tape drives on a system
@FIXME{There should be a sample program here, including an exit
before end. Is the exit status even checked in tar? :-(}
-@table @kbd
+@table @option
@item --multi-volume
@itemx -M
Creates a multi-volume archive, when used in conjunction with
@cindex Labels on the archive media
@UNREVISED
-@table @kbd
-@item -V @var{name}
-@itemx --label=@var{name}
-Create archive with volume name @var{name}.
-@end table
-
-This option causes @command{tar} to write out a @dfn{volume header} at
-the beginning of the archive. If @value{op-multi-volume} is used, each
-volume of the archive will have a volume header of @samp{@var{name}
-Volume @var{n}}, where @var{n} is 1 for the first volume, 2 for the
-next, and so on.
-
-@FIXME{Should the arg to --label be a quoted string?? No.}
-
-To avoid problems caused by misplaced paper labels on the archive
+@cindex @option{--label} option introduced
+@cindex @option{-V} option introduced
+ To avoid problems caused by misplaced paper labels on the archive
media, you can include a @dfn{label} entry---an archive member which
contains the name of the archive---in the archive itself. Use the
@value{op-label} option in conjunction with the @value{op-create} operation
to include a label entry in the archive as it is being created.
-If you create an archive using both @value{op-label} and
+@table @option
+@item --label=@var{archive-label}
+@itemx -V @var{archive-label}
+Includes an @dfn{archive-label} at the beginning of the archive when
+the archive is being created, when used in conjunction with the
+@value{op-create} operation. Checks to make sure the archive label
+matches the one specified (when used in conjunction with any other
+operation.
+@end table
+
+ If you create an archive using both @value{op-label} and
@value{op-multi-volume}, each volume of the archive will have an
archive label of the form @samp{@var{archive-label} Volume @var{n}},
where @var{n} is 1 for the first volume, 2 for the next, and so on.
@FIXME-xref{Multi-Volume Archives, for information on creating multiple
volume archives.}
-If you list or extract an archive using @value{op-label}, @command{tar} will
-print an error if the archive label doesn't match the @var{archive-label}
-specified, and will then not list nor extract the archive. In those cases,
-@var{archive-label} argument is interpreted as a globbing-style pattern
-which must match the actual magnetic volume label. @xref{exclude}, for
-a precise description of how match is attempted@footnote{Previous versions
-of @command{tar} used full regular expression matching, or before that, only
-exact string matching, instead of wildcard matchers. We decided for the
-sake of simplicity to use a uniform matching device through @command{tar}.}.
-If the switch @value{op-multi-volume} is being used, the volume label
-matcher will also suffix @var{archive-label} by @w{@samp{ Volume [1-9]*}}
-if the initial match fails, before giving up. Since the volume numbering
-is automatically added in labels at creation time, it sounded logical to
-equally help the user taking care of it when the archive is being read.
-
-The @value{op-label} was once called @samp{--volume}, but is not available
-under that name anymore.
-
-To find out an archive's label entry (or to find out if an archive has
-a label at all), use @samp{tar --list --verbose}. @command{tar} will
-print the label first, and then print archive member information, as
-in the example below:
+@cindex Volume label, listing
+@cindex Listing volume label
+ The volume label will be displayed by @option{--list} along with
+the file contents. If verbose display is requested, it will also be
+explicitely marked as in the example below:
@smallexample
+@group
$ @kbd{tar --verbose --list --file=iamanarchive}
V--------- 0 0 0 1992-03-07 12:01 iamalabel--Volume Header--
-rw-rw-rw- ringo user 40 1990-05-21 13:30 iamafilename
+@end group
@end smallexample
-@table @kbd
-@item --label=@var{archive-label}
-@itemx -V @var{archive-label}
-Includes an @dfn{archive-label} at the beginning of the archive when
-the archive is being created, when used in conjunction with the
-@value{op-create} option. Checks to make sure the archive label
-matches the one specified (when used in conjunction with the
-@value{op-extract} option.
-@end table
+@cindex @option{--test-label} option introduced
+@anchor{--test-label option}
+ However, @option{--list} option will cause listing entire
+contents of the archive, which may be undesirable (for example, if the
+archive is stored on a tape). You can request checking only the volume
+by specifying @option{--test-label} option. This option reads only the
+first block of an archive, so it can be used with slow storage
+devices. For example:
+
+@smallexample
+@group
+$ @kbd{tar --test-label --file=iamanarchive}
+iamalabel
+@end group
+@end smallexample
+
+ If @option{--test-label} is used with a single command line
+argument, @command{tar} compares the volume label with the
+argument. It exits with code 0 if the two strings match, and with code
+2 otherwise. In this case no output is displayed. For example:
+
+@smallexample
+@group
+$ @kbd{tar --test-label --file=iamanarchive 'iamalable'}
+@result{} 0
+$ @kbd{tar --test-label --file=iamanarchive 'iamalable' alabel}
+@result{} 1
+@end group
+@end smallexample
+
+ If you request any operation, other than @option{--create}, along
+with using @option{--label} option, @command{tar} will first check if
+the archive label matches the one specified and will refuse to proceed
+if it does not. Use this as a safety precaution to avoid accidentally
+overwriting existing archives. For example, if you wish to add files
+to @file{archive}, presumably labelled with string @samp{My volume},
+you will get:
-To get a common information on all tapes of a series, use the
-@value{op-label} option. For having this information different in each
+@smallexample
+@group
+$ @kbd{tar -rf archive --label 'My volume' .}
+tar: Archive not labeled to match `My volume'
+@end group
+@end smallexample
+
+@noindent
+in case its label does not match. This will work even if
+@file{archive} is not labelled at all.
+
+ Similarly, @command{tar} will refuse to list or extract the
+archive if its label doesn't match the @var{archive-label}
+specified. In those cases, @var{archive-label} argument is interpreted
+as a globbing-style pattern which must match the actual magnetic
+volume label. @xref{exclude}, for a precise description of how match
+is attempted@footnote{Previous versions of @command{tar} used full
+regular expression matching, or before that, only exact string
+matching, instead of wildcard matchers. We decided for the sake of
+simplicity to use a uniform matching device through
+@command{tar}.}. If the switch @value{op-multi-volume} is being used,
+the volume label matcher will also suffix @var{archive-label} by
+@w{@samp{ Volume [1-9]*}} if the initial match fails, before giving
+up. Since the volume numbering is automatically added in labels at
+creation time, it sounded logical to equally help the user taking care
+of it when the archive is being read.
+
+ The @value{op-label} was once called @option{--volume}, but is not available
+under that name anymore.
+
+ You can also use @option{--label} to get a common information on
+all tapes of a series. For having this information different in each
series created through a single script used on a regular basis, just
manage to get some date string as part of the label. For example:
@smallexample
+@group
$ @kbd{tar cfMV /dev/tape "Daily backup for `date +%Y-%m-%d`"}
$ @kbd{tar --create --file=/dev/tape --multi-volume \
--volume="Daily backup for `date +%Y-%m-%d`"}
+@end group
@end smallexample
-Also note that each label has its own date and time, which corresponds
+ Also note that each label has its own date and time, which corresponds
to when @GNUTAR{} initially attempted to write it,
often soon after the operator launches @command{tar} or types the
carriage return telling that the next tape is ready. Comparing date
rewinding tapes and the operator switching them were negligible, which
is usually not the case.
-@FIXME{was --volume}
-
@node verify
@section Verifying Data as It is Stored
@cindex Verifying a write operation
@cindex Double-checking a write operation
-@table @kbd
+@table @option
@item -W
@itemx --verify
Attempt to verify the archive after writing.
@appendix Free Software Needs Free Documentation
@include freemanuals.texi
+@node Genfile
+@appendix Genfile
+@include genfile.texi
+
@node Copying This Manual
@appendix Copying This Manual