This is Info file tar.info, produced by Makeinfo version 1.67 from the
input file tar.texi.

START-INFO-DIR-ENTRY
* tar: (tar).			Making tape (or disk) archives.
END-INFO-DIR-ENTRY

   This file documents GNU `tar', a utility used to store, backup, and
transport files.

   Copyright (C) 1992, 1994, 1995, 1996, 1997 Free Software Foundation,
Inc.

   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the Foundation.

   This file documents GNU `tar', which is a utility used to store,
backup, and transport files.  `tar' is a tape (or disk) archiver.  This
manual documents the release 1.12a.


File: tar.info,  Node: Multi-Volume Archives,  Next: Tape Files,  Prev: Using Multiple Tapes,  Up: Using Multiple Tapes

Archives Longer than One Tape or Disk
-------------------------------------

     *(This message will disappear, once this node revised.)*

   To create an archive that is larger than will fit on a single unit of
the media, use the `--multi-volume' (`-M') option in conjunction with
the `--create' (`-c') option (*note create::.).  A "multi-volume"
archive can be manipulated like any other archive (provided the
`--multi-volume' (`-M') option is specified), but is stored on more
than one tape or disk.

   When you specify `--multi-volume' (`-M'), `tar' does not report an
error when it comes to the end of an archive volume (when reading), or
the end of the media (when writing).  Instead, it prompts you to load a
new storage volume.  If the archive is on a magnetic tape, you should
change tapes when you see the prompt; if the archive is on a floppy
disk, you should change disks; etc.

   You can read each individual volume of a multi-volume archive as if
it were an archive by itself.  For example, to list the contents of one
volume, use `--list' (`-t'), without `--multi-volume' (`-M') specified.
To extract an archive member from one volume (assuming it is on that
volume), use `--extract' (`--get', `-x'), again without
`--multi-volume' (`-M').

   If an archive member is split across volumes (ie. its entry begins on
one volume of the media and ends on another), you need to specify
`--multi-volume' (`-M') to extract it successfully.  In this case, you
should load the volume where the archive member starts, and use `tar
--extract --multi-volume'--`tar' will prompt for later volumes as it
needs them.  *Note extracting archives::, for more information about
extracting archives.

   `--info-script=SCRIPT-NAME' (`--new-volume-script=SCRIPT-NAME', `-F
SCRIPT-NAME') is like `--multi-volume' (`-M'), except that `tar' does
not prompt you directly to change media volumes when a volume is
full--instead, `tar' runs commands you have stored in SCRIPT-NAME.  For
example, this option can be used to eject cassettes, or to broadcast
messages such as `Someone please come change my tape' when performing
unattended backups.  When SCRIPT-NAME is done, `tar' will assume that
the media has been changed.

   Multi-volume archives can be modified like any other archive.  To add
files to a multi-volume archive, you need to only mount the last volume
of the archive media (and new volumes, if needed).  For all other
subcommands, you need to use the entire archive.

   If a multi-volume archive was labeled using `--label=ARCHIVE-LABEL'
(`-V ARCHIVE-LABEL') (*note label::.) when it was created, `tar' will
not automatically label volumes which are added later.  To label
subsequent volumes, specify `--label=ARCHIVE-LABEL' (`-V
ARCHIVE-LABEL') again in conjunction with the `--append' (`-r'),
`--update' (`-u') or `--concatenate' (`--catenate', `-A') subcommand.

`--multi-volume'
`-M'
     Creates a multi-volume archive, when used in conjunction with
     `--create' (`-c').  To perform any other subcommand on a
     multi-volume archive, specify `--multi-volume' (`-M') in
     conjunction with that subcommand.

`--info-script=PROGRAM-FILE'
`-F PROGRAM-FILE'
     Creates a multi-volume archive via a script.  Used in conjunction
     with `--create' (`-c').

   Beware that there is *no* real standard about the proper way, for a
`tar' archive, to span volume boundaries.  If you have a multi-volume
created by some vendor's `tar', there is almost no chance you could
read all the volumes with GNU `tar'.  The converse is also true: you
may not expect multi-volume archives created by GNU `tar' to be fully
recovered by vendor's `tar'.  Since there is little chance that, in
mixed system configurations, some vendor's `tar' will work on another
vendor's machine, and there is a great chance that GNU `tar' will work
on most of them, your best bet is to install GNU `tar' on all machines
between which you know exchange of files is possible.


File: tar.info,  Node: Tape Files,  Prev: Multi-Volume Archives,  Up: Using Multiple Tapes

Tape Files
----------

     *(This message will disappear, once this node revised.)*

   To give the archive a name which will be recorded in it, use the
`--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') option.  This will write a
special block identifying VOLUME-LABEL as the name of the archive to
the front of the archive which will be displayed when the archive is
listed with `--list' (`-t').  If you are creating a multi-volume
archive with `--multi-volume' (`-M') (), then the volume label will have
`Volume NNN' appended to the name you give, where NNN is the number of
the volume of the archive.  If you use the `--label=ARCHIVE-LABEL' (`-V
ARCHIVE-LABEL') option when reading an archive, it checks to make sure
the label on the tape matches the one you give.  *Note label::.

   When `tar' writes an archive to tape, it creates a single tape file.
If multiple archives are written to the same tape, one after the
other, they each get written as separate tape files.  When extracting,
it is necessary to position the tape at the right place before running
`tar'.  To do this, use the `mt' command.  For more information on the
`mt' command and on the organization of tapes into a sequence of tape
files, see *Note mt::.

   People seem to often do:

     tar --label="SOME-PREFIX `date +SOME-FORMAT`"

   or such, for pushing a common date in all volumes or an archive set.


File: tar.info,  Node: label,  Next: verify,  Prev: Using Multiple Tapes,  Up: Media

Including a Label in the Archive
================================

     *(This message will disappear, once this node revised.)*

`-V NAME'
`--label=NAME'
     Create archive with volume name NAME.

   This option causes `tar' to write out a "volume header" at the
beginning of the archive.  If `--multi-volume' (`-M') is used, each
volume of the archive will have a volume header of `NAME Volume N',
where N is 1 for the first volume, 2 for the next, and so on.

   To avoid problems caused by misplaced paper labels on the archive
media, you can include a "label" entry--an archive member which
contains the name of the archive--in the archive itself.  Use the
`--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') option in conjunction with
the `--create' (`-c') subcommand to include a label entry in the
archive as it is being created.

   If you create an archive using both `--label=ARCHIVE-LABEL' (`-V
ARCHIVE-LABEL') and `--multi-volume' (`-M'), each volume of the archive
will have an archive label of the form `ARCHIVE-LABEL Volume N', where
N is 1 for the first volume, 2 for the next, and so on.  *Note
Multi-Volume Archives::, for information on creating multiple volume
archives.

   If you list or extract an archive using `--label=ARCHIVE-LABEL' (`-V
ARCHIVE-LABEL'), `tar' will print an error if the archive label doesn't
match the ARCHIVE-LABEL specified, and will then not list nor extract
the archive.  In those cases, ARCHIVE-LABEL argument is interpreted as
a globbing-style pattern which must match the actual magnetic volume
label.  *Note exclude::, for a precise description of how match is
attempted(1).  If the switch `--multi-volume' (`-M') is being used, the
volume label matcher will also suffix ARCHIVE-LABEL by ` 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 `--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') was once called
`--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 `tar --list --verbose'.  `tar' will print the
label first, and then print archive member information, as in the
example below:

     $ 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

`--label=ARCHIVE-LABEL'
`-V ARCHIVE-LABEL'
     Includes an "archive-label" at the beginning of the archive when
     the archive is being created, when used in conjunction with the
     `--create' (`-c') option.  Checks to make sure the archive label
     matches the one specified (when used in conjunction with the
     `--extract' (`--get', `-x') option).

   To get a common information on all tapes of a series, use the
`--label=ARCHIVE-LABEL' (`-V ARCHIVE-LABEL') option.  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:

     $ tar cfMV /dev/tape "Daily backup for `date +%Y-%m-%d`"
     $ tar --create --file=/dev/tape --multi-volume \
          --label="Daily backup for `date +%Y-%m-%d`"

   Also note that each label has its own date and time, which
corresponds to when GNU `tar' initially attempted to write it, often
soon after the operator launches `tar' or types the carriage return
telling that the next tape is ready.  Comparing date labels does give
an idea of tape throughput only if the delays for rewinding tapes and
the operator switching them were negligible, which is ususally not the
case.

   ---------- Footnotes ----------

   (1)  Previous versions of `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 `tar'.


File: tar.info,  Node: verify,  Next: Write Protection,  Prev: label,  Up: Media

Verifying Data as It is Stored
==============================

`-W'
`--verify'
     Attempt to verify the archive after writing.

   This option causes `tar' to verify the archive after writing it.
Each volume is checked after it is written, and any discrepancies are
recorded on the standard error output.

   Verification requires that the archive be on a back-space-able
medium.  This means pipes, some cartridge tape drives, and some other
devices cannot be verified.

   You can insure the accuracy of an archive by comparing files in the
system with archive members.  `tar' can compare an archive to the file
system as the archive is being written, to verify a write operation, or
can compare a previously written archive, to insure that it is up to
date.

   To check for discrepancies in an archive immediately after it is
written, use the `--verify' (`-W') option in conjunction with the
`--create' (`-c') subcommand.  When this option is specified, `tar'
checks archive members against their counterparts in the file system,
and reports discrepancies on the standard error.  In multi-volume
archives, each volume is verified after it is written, before the next
volume is written.

   To verify an archive, you must be able to read it from before the end
of the last written entry.  This option is useful for detecting data
errors on some tapes.  Archives written to pipes, some cartridge tape
drives, and some other devices cannot be verified.

   One can explicitly compare an already made archive with the file
system by using the `--compare' (`--diff', `-d') option, instead of
using the more automatic `--verify' (`-W') option.  *Note compare::.

   Note that these two options have a slightly different intent.  The
`--compare' (`--diff', `-d') option checks how identical are the
logical contents of some archive with what is on your disks, while the
`--verify' (`-W') option is really for checking if the physical
contents agree and if the recording media itself is of dependable
quality.  So, for the `--verify' (`-W') option, `tar' tries to defeat
all in-memory cache pertaining to the archive, while it lets the speed
optimization undisturbed for the `--compare' (`--diff', `-d') option.
If you nevertheless use `--compare' (`--diff', `-d') for media
verification, you may have to defeat the in-memory cache yourself,
maybe by opening and reclosing the door latch of your recording unit,
forcing some doubt in your operating system about the fact this is
really the same volume as the one just written or read.

   The `--verify' (`-W') option would not be necessary if drivers were
indeed able to detect dependably all write failures.  This sometimes
require many magnetic heads, some able to read after the writes
occurred.  One would not say that drivers unable to detect all cases
are necessarily flawed, as long as programming is concerned.


File: tar.info,  Node: Write Protection,  Prev: verify,  Up: Media

Write Protection
================

   Almost all tapes and diskettes, and in a few rare cases, even disks
can be "write protected", to protect data on them from being changed.
Once an archive is written, you should write protect the media to
prevent the archive from being accidently overwritten or deleted.
(This will protect the archive from being changed with a tape or floppy
drive--it will not protect it from magnet fields or other physical
hazards).

   The write protection device itself is usually an integral part of the
physical media, and can be a two position (write enabled/write
disabled) switch, a notch which can be popped out or covered, a ring
which can be removed from the center of a tape reel, or some other
changeable feature.


File: tar.info,  Node: tar invocation,  Next: All Options,  Prev: Media,  Up: Top

Invoking GNU `tar'
******************

     *(This message will disappear, once this node revised.)*

   This chapter is about how one invokes the GNU `tar' command, from
the command synopsis (*note Synopsis::.).  There are numerous options,
and many styles for writing them.  One mandatory option specifies the
subcommand `tar' should perform (*note Subcommand Summary::.), other
options are meant to detail how this subcommand should be performed
(*note Option Summary::.).  Non-option arguments are not always
interpreted the same way, depending on what the subcommand is.

   You will find in this chapter everything about option styles and
rules for writing them (*note Styles::.).  On the other hand,
subcommands and options are fully described elsewhere, in other
chapters.  Here, you will find only synthetic descriptions for
subcommands and options, together with pointers to other parts of the
`tar' manual.

   Some options are so special they are fully described right in this
chapter.  They have the effect of inhibiting the normal operation of
`tar' or else, they globally alter the amount of feedback the user
receives about what is going on.  These are the `--help' and
`--version' (), `--verbose' (`-v') (*note verbose::.) and
`--interactive' (`-w') options (*note interactive::.).

* Menu:

* Synopsis::
* using tar options::
* Styles::


File: tar.info,  Node: Synopsis,  Next: using tar options,  Prev: tar invocation,  Up: tar invocation

General Synopsis of `tar'
=========================

   The GNU `tar' program is invoked as either one of:

     tar OPTION... [NAME]...
     tar LETTER... [ARGUMENT]... [OPTION]... [NAME]...

   The second form is for when old options are being used.

   You can use `tar' to store files in an archive, to extract them from
an archive, and to do other types of archive manipulation.  The primary
argument to `tar', which is called the "subcommand", specifies which
action to take.  The other arguments to `tar' are either "options",
which change the way `tar' performs a subcommand, or file names or
archive members, which specify the files or members `tar' is to act on.

   You can actually type in arguments in any order, even if in this
manual the options always precede the other arguments, to make examples
easier to understand.  Further, the option stating the main subcommand
mode (the `tar' main command) is usually given first.

   Each NAME in the synopsis above is interpreted as an archive member
name when the main command is one of `--compare' (`--diff', `-d'),
`--delete', `--extract' (`--get', `-x'), `--list' (`-t') or `--update'
(`-u').  When naming archive members, you must give the exact name of
the member in the archive, as it is printed by `--list' (`-t').  For
`--append' (`-r') and `--create' (`-c'), these NAME arguments specify
the names of either files or directory hierarchies to place in the
archive.  These files or hierarchies should already exist in the file
system, prior to the execution of the `tar' command.

   `tar' interprets relative file names as being relative to the
working directory.  `tar' will make all file names relative (by
removing leading slashes when archiving or restoring files), unless you
specify otherwise (using the `--absolute-names' (`-P') option).
*Note absolute::, for more information about `--absolute-names' (`-P').

   If you give the name of a directory as either a file name or a member
name, then `tar' acts recursively on all the files and directories
beneath that directory.  For example, the name `/' identifies all the
files in the filesystem to `tar'.

   The distinction between file names and archive member names is
especially important when shell globbing is used, and sometimes a
source of confusion for newcomers.  *Note Wildcards::, for more
information about globbing.  The problem is that shells may only glob
using existing files in the file system.  Only `tar' itself may glob on
archive members, so when needed, you must ensure that wildcard
characters reach `tar' without being interpreted by the shell first.
Using a backslash before `*' or `?', or putting the whole argument
between quotes, is usually sufficient for this.  (On MS-DOS/MS-Windows,
you *must* use quotes, since the backslash is a directory separator,
and cannot be used to escape-protect wildcard characters.)

   Even if NAMEs are often specified on the command line, they can also
be read from a text file in the file system, using the
`--files-from=FILE-OF-NAMES' (`-T FILE-OF-NAMES') option.

   If you don't use any file name arguments, `--append' (`-r'),
`--delete' and `--concatenate' (`--catenate', `-A') will do nothing,
while `--create' (`-c') will usually yield a diagnostic and inhibit
`tar' execution.  The other subcommands of `tar' (`--list' (`-t'),
`--extract' (`--get', `-x'), `--compare' (`--diff', `-d'), and
`--update' (`-u')) will act on the entire contents of the archive.

   Besides successful exits, GNU `tar' may fail for many reasons.  Some
reasons correspond to bad usage, that is, when the `tar' command is
improperly written.  Errors may be encountered later, while processing
the archive or the files.  Some errors are recoverable, in which case
the failure is delayed until `tar' has completed all its work.  Some
errors are such that it would be not meaningful, or at least risky, to
continue processing: `tar' then aborts processing immediately.  All
abnormal exits, whether immediate or delayed, should always be clearly
diagnosed on `stderr', after a line stating the nature of the error.

   GNU `tar' returns only a few exit statuses.  I'm really aiming
simplicity in that area, for now.  If you are not using the `--compare'
(`--diff', `-d') option, zero means that everything went well, besides
maybe innocuous warnings.  Nonzero means that something went wrong.  As
of today, "nonzero" is almost always 2, except for remote subcommands,
where it may be 128.


File: tar.info,  Node: using tar options,  Next: Styles,  Prev: Synopsis,  Up: tar invocation

Using `tar' Options
===================

   GNU `tar' has a total of eight operating modes which allow you to
perform a variety of tasks.  You are required to choose one operating
mode each time you employ the `tar' program by specifying one, and only
one subcommand as an argument to the `tar' command (two lists of four
subcommands each may be found at *Note frequent subcommands:: and ).
Depending on circumstances, you may also wish to customize how the
chosen operating mode behaves.  For example, you may wish to change the
way the output looks, or the format of the files that you wish to
archive may require you to do something special in order to make the
archive look right.

   You can customize and control `tar''s performance by running `tar'
with one or more options (such as `--verbose' (`-v'), which we used in
the tutorial).  As we said in the tutorial, "options" are arguments to
`tar' which are (as their name suggests) optional.  Depending on the
operating mode, you may specify one or more options.  Different options
will have different effects, but in general they all change details of
how `tar' works on archives, such as archive format, archive name, or
level of user interaction.  Some options make sense with all operating
modes, while others are meaningful only with particular modes.  You
will likely use some options frequently, while you will only use others
infrequently, or not at all.  (A full list of options is available in
*note All Options::..)

   Note that `tar' options are case sensitive.  For example, the
options `-T' and `-t' are different; the first requires an argument for
stating the name of a file providing a list of NAMEs, while the second
does not require an argument and is another way to write `--list'
(`-t').

   In addition to the eight subcommands, there are many options to
`tar', and three different styles for writing both: long (mnemonic)
form, short form, and old style.  These styles are discussed below.
Both the options and the subcommands can be written in any of these
three styles.


File: tar.info,  Node: Styles,  Prev: using tar options,  Up: tar invocation

The Three Option Styles
=======================

   There are three styles for writing subcommands and options to the
command line invoking `tar'.  The different styles were developed at
different times during the history of `tar'.  These styles will be
presented below, from the most recent to the oldest.

   Some options must take an argument.  (For example,
`--file=ARCHIVE-NAME' (`-f ARCHIVE-NAME') takes the name of an archive
file as an argument.  If you do not supply an archive file name, `tar'
will use a default, but this can be confusing; thus, we recommend that
you always supply a specific archive file name.)  Where you *place* the
arguments generally depends on which style of options you choose.  We
will detail specific information relevant to each option style in the
sections on the different option styles, below.  The differences are
subtle, yet can often be very important; incorrect option placement can
cause you to overwrite a number of important files.  We urge you to
note these differences, and only use the option style(s) which makes
the most sense to you until you feel comfortable with the others.

* Menu:

* Mnemonic Options::            Mnemonic Option Style
* Short Options::               Short Option Style
* Old Options::                 Old Option Style
* Mixing::                      Mixing Option Styles


File: tar.info,  Node: Mnemonic Options,  Next: Short Options,  Prev: Styles,  Up: Styles

Mnemonic Option Style
---------------------

   Each option has at least one long (or mnemonic) name starting with
two dashes in a row, e.g. `--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 names which are synonymous,
such as `--compare' and `--diff'.  In addition, long option names can
be given unique abbreviations.  For example, `--cre' can be used in
place of `--create' because there is no other mnemonic option which
begins with `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, `tar' will tell you that that abbreviation is
ambiguous and you'll know that that abbreviation won't work.  You may
also choose to run `tar --help' to see a list of options.  Be aware
that if you run `tar' with a unique abbreviation for the long name of
an option you didn't want to use, you are stuck; `tar' will perform the
command as ordered.)

   Mnemonic options are meant to be obvious and easy to remember, and
their meanings are generally easier to discern than those of their
corresponding short options (see below).  For example:

     $ tar --create --verbose --blocking-factor=20 --file=/dev/rmt0

gives a fairly good set of hints about what the command does, even for
those not fully acquainted with `tar'.

   Mnemonic options which require arguments take those arguments
immediately following the option name; they are introduced by an equal
sign.  For example, the `--file' option (which tells the name of the
`tar' archive) is given a file such as `archive.tar' as argument by
using the notation `--file=archive.tar' for the mnemonic option.


File: tar.info,  Node: Short Options,  Next: Old Options,  Prev: Mnemonic Options,  Up: Styles

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. `-t' (which
is equivalent to `--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
`-f archive.tar' or `-farchive.tar' instead of using
`--file=archive.tar'.  Both `--file=ARCHIVE-NAME' and `-f ARCHIVE-NAME'
denote the option which indicates a specific archive, here named
`archive.tar'.

   Short options' letters may be clumped together, but you are not
required to do this (as compared to old options; see below).  When short
options are clumped as a set, use one (single) dash for them all, e.g.
``tar' -cvf'.  Only the last option in such a set is allowed to have an
argument(1).

   When the options are separated, the argument for each option which
requires an argument directly follows that option, as is usual for Unix
programs.  For example:

     $ tar -c -v -b 20 -f /dev/rmt0

   If you reorder short options' locations, be sure to move any
arguments that belong to them.  If you do not move the arguments
properly, you may end up overwriting files.

   ---------- Footnotes ----------

   (1)  Clustering many options, the last of which has an argument, is
a rather opaque way to write options.  Some wonder if GNU `getopt'
should not even be made helpful enough for considering such usages as
invalid.


File: tar.info,  Node: Old Options,  Next: Mixing,  Prev: Short Options,  Up: Styles

Old Option Style
----------------

     *(This message will disappear, once this node revised.)*

   Like short options, old options are single letters.  However, old
options must be written together as a single clumped set, without
spaces separating them or dashes preceding them(1).  This set of
letters must be the first to appear on the command line, after the
`tar' program name and some whitespace; 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 `t' is
the same as the short option `-t', and consequently, the same as the
mnemonic option `--list'.  So for example, the command `tar cv'
specifies the option `-v' in addition to the subcommand `-c'.

   When options that need arguments are given together with the command,
all the associated arguments follow, in the same order as the options.
Thus, the example given previously could also be written in the old
style as follows:

     $ tar cvbf 20 /dev/rmt0

Here, `20' is the argument of `-b' and `/dev/rmt0' is the argument of
`-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 `tar cvbf 20 /dev/rmt0', for example, `20'
is the argument for `-b', `/dev/rmt0' is the argument for `-f', and
`-v' does not have a corresponding argument.  Even using short options
like in `tar -c -v -b 20 -f /dev/rmt0' is clearer, putting all
arguments next to the option they pertain to.

   If you want to reorder the letters in the old option argument, be
sure to reorder any corresponding argument appropriately.

   This old way of writing `tar' options can surprise even experienced
users.  For example, the two commands:

     tar cfz archive.tar.gz file
     tar -cfz archive.tar.gz file

are quite different.  The first example uses `archive.tar.gz' as the
value for option `f' and recognizes the option `z'.  The second
example, however, uses `z' as the value for option `-f'--probably not
what was intended.

   Old options are kept for compatibility with old versions of `tar'.

   This second example could be corrected in many ways, among which the
following are equivalent:

     tar -czf archive.tar.gz file
     tar -cf archive.tar.gz -z file
     tar cf archive.tar.gz -z file

   As far as we know, all `tar' programs, GNU and non-GNU, support old
options.  GNU `tar' supports them not only for historical reasons, but
also because many people are used to them.  For compatibility with Unix
`tar', the first argument is always treated as containing command and
option letters even if it doesn't start with `-'.  Thus, `tar c' is
equivalent to `tar -c': both of them specify the `--create' (`-c')
command to create an archive.

   ---------- Footnotes ----------

   (1)  Beware that if you precede options with a dash, you are
announcing the short option style instead of the old option style;
short options are decoded differently.


File: tar.info,  Node: Mixing,  Prev: Old Options,  Up: Styles

Mixing Option Styles
--------------------

   All three styles may be intermixed in a single `tar' command, so
long as the rules for each style are fully respected(1).  Old style
options and either of the modern styles of options may be mixed within
a single `tar' command.  However, old style options must be introduced
as the first arguments only, following the rule for old options (old
options must appear directly after the `tar' command and some
whitespace).  Modern options may be given only after all arguments to
the old options have been collected.  If this rule is not respected, a
modern option might be falsely interpreted as the value of the argument
to one of the old style options.

   For example, all the following commands are wholly equivalent, and
illustrate the many combinations and orderings of option styles.

     tar --create --file=archive.tar
     tar --create -f archive.tar
     tar --create -farchive.tar
     tar --file=archive.tar --create
     tar --file=archive.tar -c
     tar -c --file=archive.tar
     tar -c -f archive.tar
     tar -c -farchive.tar
     tar -cf archive.tar
     tar -cfarchive.tar
     tar -f archive.tar --create
     tar -f archive.tar -c
     tar -farchive.tar --create
     tar -farchive.tar -c
     tar c --file=archive.tar
     tar c -f archive.tar
     tar c -farchive.tar
     tar cf archive.tar
     tar f archive.tar --create
     tar f archive.tar -c
     tar fc archive.tar

   On the other hand, the following commands are *not* equivalent to
the previous set:

     tar -f -c archive.tar
     tar -fc archive.tar
     tar -fcarchive.tar
     tar -farchive.tarc
     tar cfarchive.tar

These last examples mean something completely different from what the
user intended (judging by the example in the previous set which uses
long options, whose intent is therefore very clear).  The first four
specify that the `tar' archive would be a file named `-c', `c',
`carchive.tar' or `archive.tarc', respectively.  The first two examples
also specify a single non-option, NAME argument having the value
`archive.tar'.  The last example contains only old style option letters
(repeating option `c' twice), not all of which are meaningful (eg., `.',
`h', or `i'), with no argument value.

   ---------- Footnotes ----------

   (1)  Before GNU `tar' version 1.11.6, a bug prevented intermixing
old style options with mnemonic options in some cases.


File: tar.info,  Node: All Options,  Next: documentation and help,  Prev: tar invocation,  Up: Top

All `tar' Options
*****************

   The coming manual sections contain an alphabetical listing of all
`tar' subcommands and options, with brief descriptions and cross
references to more in-depth explanations in the body of the manual.
They also contain an alphabetically arranged table of the short option
forms with their corresponding long option.  You can use this table as
a reference for deciphering `tar' commands in scripts.

* Menu:

* Subcommand Summary::
* Option Summary::
* Short Option Summary::


File: tar.info,  Node: Subcommand Summary,  Next: Option Summary,  Prev: All Options,  Up: All Options

Subcommands
-----------

`--append'
`-r'
     Appends files to the end of the archive.  *Note append::.

`--catenate'
`-A'
     Same as `--concatenate'.  *Note concatenate::.

`--compare'
`-d'
     Compares archive members with their counterparts in the file
     system, and reports differences in file size, mode, owner,
     modification date and contents.  *Note compare::.

`--concatenate'
`-A'
     Appends other `tar' archives to the end of the archive.  *Note
     concatenate::.

`--create'
`-c'
     Creates a new `tar' archive.  *Note create::.

`--delete'
     Deletes members from the archive.  Don't try this on an archive on
     a magnetic tape!  *Note delete::.

`--diff'
`-d'
     Same `--compare'.  *Note compare::.

`--extract'
`-x'
     Extracts members from the archive into the file system.  *Note
     extract::.

`--get'
`-x'
     Same as `--extract'.   *Note extract::.

`--list'
`-t'
     Lists the members in an archive.  *Note list::.

`--update'
`-u'
     Adds files to the end of the archive, but only if they are newer
     than their counterparts already in the archive, or if they do not
     already exist in the archive.  *Note update::.


File: tar.info,  Node: Option Summary,  Next: Short Option Summary,  Prev: Subcommand Summary,  Up: All Options

`tar' Options
-------------

`-[0-7][lmh]'
     Specify drive and density.  *Note Device::.

`--absolute-names'
`-P'
     Normally when creating an archive, `tar' converts absolute file
     names to relative, by stripping an initial `/' from member names
     (on MS-DOS and MS-Windows, `tar' also strips the drive letter and
     the colon that follows it).  This option disables that behavior.
     *Note absolute::.

`--after-date'
     (See `--newer'; *note after::..)

`--atime-preserve'
     Tells `tar' to preserve the access time field in a file's inode
     when dumping it.  *Note Attributes::.

`--backup=BACKUP-TYPE'
     Rather than deleting files from the file system, `tar' will back
     them up using simple or numbered backups, depending upon
     BACKUP-TYPE.  *Note backup::.

`--block-number'
`-R'
     With this option present, `tar' prints error messages for read
     errors with the block number in the archive file.  *Note verbose::.

`--blocking-factor=BLOCKING'
`-b BLOCKING'
     Sets the blocking factor `tar' uses to BLOCKING x 512 bytes per
     record.  *Note Blocking Factor::.

`--checkpoint'
     This option directs `tar' to print periodic checkpoint messages as
     it reads through the archive.  It's intended for when you want a
     visual indication that `tar' is still running, but don't want to
     see `--verbose' output.  *Note verbose::.

`--compress'
`--uncompress'
`-Z'
     `tar' will use the `compress' program when reading or writing the
     archive.  This allows you to directly act on archives while saving
     space.  *Note gzip::.

`--confirmation'
     (See `--interactive' and *note verbose::..)

`--dereference'
`-h'
     When creating a `tar' archive, `tar' will archive the file that a
     symbolic link points to, rather than archiving the symlink.  *Note
     dereference::.

`--directory=DIR'
`-C DIR'
     When this option is specified, `tar' will change its current
     directory to DIR before performing any subcommands.  When this
     option is used during archive creation, it is order sensitive.
     *Note directory::.

`--exclude=PATTERN'
     When performing subcommands, `tar' will skip files that match
     PATTERN.  *Note exclude::.

`--exclude-from=FILE'
`-X FILE'
     Similar to `--exclude', except `tar' will use the list of patterns
     in the file FILE.  *Note exclude::.

`--file=ARCHIVE'
`-f ARCHIVE'
     `tar' will use the file ARCHIVE as the `tar' archive it performs
     subcommands on, rather than `tar''s compilation-dependent default.
     *Note file:: and *Note Device::.

`--files-from=FILE'
`-T FILE'
     `tar' will use the contents of FILE as a list of archive members
     or files to operate on, in addition to those specified on the
     command-line.  *Note files::.

`--force-local'
     Forces `tar' to interpret the filename given to `--file' as a local
     file, even if it looks like a remote tape drive name.  *Note
     Device::.

`--group=GROUP'
     Files added to the `tar' archive will have a group id of GROUP,
     rather than the group from the source file.  *Note Attributes::.

     Also see the comments for the `--owner=USER' option.

`--gunzip'
     (See `--gzip'; *note gzip::..)

`--gzip'
`--gunzip'
`--ungzip'
`-z'
     This option tells `tar' to read or write archives through `gzip',
     allowing `tar' to directly operate on several kinds of compressed
     archives transparently.  *Note gzip::.

`--help'
     `tar' will print out a short message summarizing the subcommands
     and options to `tar' and exit.  *Note help tutorial::.

`--ignore-failed-read'
     Instructs `tar' to exit successfully if it encounters an
     unreadable file.  *Note Ignore Failed Read::.

`--ignore-umask'
     (See `--preserve-permissions'; *note Writing::..)

`--ignore-zeros'
`-i'
     With this option, `tar' will ignore zeroed blocks in the archive,
     which normally signals EOF.  *Note Ignore Zeros:: and *Note
     Blocking Factor::.

`--incremental'
`-G'
     Used to inform `tar' that it is working with an  old GNU-format
     incremental backup archive.  It is intended primarily for backwards
     compatibility.  *Note incremental and listed-incremental::.

`--info-script=SCRIPT-FILE'
`--new-volume-script=SCRIPT-FILE'
`-F SCRIPT-FILE'
     When `tar' is performing multi-tape backups, SCRIPT-FILE is run at
     the end of each tape.  *Note Device:: and *Note Using Multiple
     Tapes::.

`--interactive'
`--confirmation'
`-w'
     Specifies that `tar' should ask the user for confirmation before
     performing potentially destructive options, such as overwriting
     files.  *Note verbose::.

`--keep-old-files'
`-k'
     When extracting files from an archive, `tar' will not overwrite
     existing files if this option is present.  *Note Keep Old Files::.

`--label=NAME'
`-V NAME'
     When creating an archive, instructs `tar' to write NAME as a name
     record in the archive.  When extracting or listing archives, `tar'
     will only operate on archives that have a label matching the
     pattern specified in NAME.  *Note mt:: and *Note label::.

`--listed-incremental=SNAPSHOT-FILE'
`-g SNAPSHOT-FILE'
     During a `--create' subcommand, specifies that the archive that
     `tar' creates is a new GNU-format incremental backup, using
     SNAPSHOT-FILE to determine which files to backup.  With other
     subcommands, informs `tar' that the archive is in incremental
     format.  *Note incremental and listed-incremental::.

`--mode=PERMISSIONS'
     When adding files to an archive, `tar' will use PERMISSIONS for
     the archive members, rather than the permissions from the files.
     The program `chmod' and this `tar' option share the same syntax
     for what PERMISSIONS might be.  *Note Permissions:
     (filetutils)File permissions.  This reference also has useful
     information for those not being overly familiar with the Unix
     permission system.

     Of course, PERMISSIONS might be plainly specified as an octal
     number.  However, by using generic symbolic modifications to mode
     bits, this allows more flexibility.  For example, the value `a+rw'
     adds read and write permissions for everybody, while retaining
     executable bits on directories or on any other file already marked
     as executable.

`--multi-volume'
`-M'
     Informs `tar' that it should create or otherwise operate on a
     multi-volume `tar' archive.  *Note Multi-Volume Archives:: and
     *Note Using Multiple Tapes::.

`--name-prefix=PREFIX'
     When used with a create or append operation, this option tells
     `tar' to prepend the given prefix to each archive file name as it
     is gathered into the archive.  This prefix won't show in any
     `--verbose' (`-v') progress message, but it will if you list the
     archive.

`--new-volume-script'
     (see -info-script)

`--newer=DATE'
`--after-date=DATE'
`-N'
     When creating an archive, `tar' will only add files that have
     changed since DATE.  *Note after::.

`--newer-mtime'
     In conjunction with `--newer', `tar' will only add files whose
     contents have changed (as opposed to just `--newer', which will
     also back up files for which any status information has changed).
     On MS-DOS, where there is only one time stamp for a file, `--newer'
     and `--newer-mtime' have identical effect.  *Note after::.

`--no-recursion'
     With this option, `tar' will not recurse into directories unless a
     directory is explicitly named as an argument to `tar'.  *Note
     recurse::.

`--null'
     When `tar' is using the `--files-from' option, this option
     instructs `tar' to expect filenames terminated with `NUL', so
     `tar' can correctly work with file names that contain newlines.
     *Note nul::.

`--numeric-owner'
     This option will notify `tar' that it should use numeric user and
     group IDs when creating a `tar' file, rather than names.  *Note
     Attributes::.

`--old-archive'
     (See `--portability'; *note old::..)

`--one-file-system'
`-l'
     Used when creating an archive.  Prevents `tar' from recursing into
     directories that are on different file systems from the current
     directory.  *Note one::.

`--owner=USER'
     Specifies that `tar' should use USER as the owner of members when
     creating archives, instead of the user associated with the source
     file.  *Note Attributes::.

`--portability'
`--old-archive'
`-o'
     Tells `tar' to create an archive that is compatible with Unix V7
     `tar'.  *Note old::.

`--posix'
     Instructs `tar' to create a POSIX compliant `tar' archive.  *Note
     posix::.

`--preserve'
     Synonymous with specifying both `--preserve-permissions' and
     `--same-order'.  *Note Attributes::.

`--preserve-order'
     (See `--same-order'; *note Same Order::..)

`--preserve-permissions'
`--same-permissions'
`-p'
     When `tar' is extracting an archive, it normally subtracts the
     users' umask from the permissions specified in the archive and
     uses that number as the permissions to create the destination
     file.  Specifying this option instructs `tar' that it should use
     the permissions directly from the archive.  *Note Setting Access
     Permissions:: and *Note Attributes::.

`--read-full-records'
`-B'
     Specifies that `tar' should reblock its input, for reading from
     pipes on systems with buggy implementations.  *Note Reading:: and
     *Note Blocking::.

`--record-size=SIZE'
     Instructs `tar' to use SIZE bytes per record when accessing the
     archive.  *Note Blocking::.

`--recursive-unlink'
     Similar to the `--unlink-first' option, removing existing
     directory hierarchies before extracting directories of the same
     name from the archive.  *Note Recursive Unlink::.

`--remove-files'
     Directs `tar' to remove the source file from the file system after
     appending it to an archive.  *Note remove files::.

`--rsh-command=CMD'
     Notifies `tar' that is should use CMD to communicate with remote
     devices.  *Note Device::.

`--same-order'
`--preserve-order'
`-s'
     This option is an optimization for `tar' when running on machines
     with small amounts of memory.  It informs `tar' that the list of
     file arguments has already been sorted to match the order of files
     in the archive.  *Note Same Order::.

`--same-owner'
     When extracting an archive, `tar' will attempt to preserve the
     owner specified in the `tar' archive with this option present.
     *Note Attributes::.

`--same-permissions'
     (See `--preserve-permissions'; *note Writing::..)

`--show-omitted-dirs'
     Instructs `tar' to mention directories it's skipping over when
     operating on a `tar' archive.  *Note verbose::.

`--sparse'
`-S'
     Invokes a GNU extension when adding files to an archive that
     handles sparse files efficiently.  *Note sparse::.

`--starting-file=NAME'
`-K NAME'
     This option affects extraction only; `tar' will skip extracting
     files in the archive until it finds one that matches NAME.  *Note
     Starting File::.

`--suffix=SUFFIX'
     Alters the suffix `tar' uses when backing up files from the default
     `~'.  *Note backup::.

`--tape-length=NUM'
`-L NUM'
     Specifies the length of tapes that `tar' is writing as being
     NUM x 1024 bytes long.  *Note Device::.

`--to-stdout'
`-O'
     During extraction, `tar' will extract files to stdout rather than
     to the file system.  *Note Writing to Standard Output::.

`--totals'
     Displays the total number of bytes written after creating an
     archive.  *Note verbose::.

`--touch'
`-m'
     Sets the modification time of extracted files to the extraction
     time, rather than the modification time stored in the archive.
     *Note Modification Times::.

`--uncompress'
     (See `--compress'; *note gzip::..)

`--ungzip'
     (See `--gzip'; *note gzip::..)

`--unlink-first'
`-U'
     Directs `tar' to remove the corresponding file from the file system
     before extracting it from the archive.  *Note Prevention
     Overwriting::.

`--use-compress-program=PROG'
     Instructs `tar' to access the archive through PROG, which is
     presumed to be a compression program of some sort.  *Note gzip::.

`--verbose'
`-v'
     Specifies that `tar' should be more verbose about the subcommands
     its performing.  This option can be specified multiple times for
     some subcommands to increase the amount of information displayed.
     *Note verbose::.

`--verify'
`-W'
     Verifies that the archive was correctly written when creating an
     archive.  *Note verify::.

`--version'
     `tar' will print an informational message about what version it is
     and a copyright message, some credits, and then exit.  *Note help
     tutorial::.

`--volno-file=FILE'
     Used in conjunction with `--multi-volume'.  `tar' will keep track
     of which volume of a multi-volume archive its working in FILE.
     *Note Using Multiple Tapes::.


File: tar.info,  Node: Short Option Summary,  Prev: Option Summary,  Up: All Options

Short Options Cross Reference
-----------------------------

   Here is an alphabetized list of all of the short option forms,
matching them with the equivalent long option.

`-A'
     `--concatenate'

`-B'
     `--read-full-records'

`-C'
     `--directory'

`-F'
     `--info-script'

`-G'
     `--incremental'

`-K'
     `--starting-file'

`-L'
     `--tape-length'

`-M'
     `--multi-volume'

`-N'
     `--newer'

`-O'
     `--to-stdout'

`-P'
     `--absolute-names'

`-R'
     `--block-number'

`-S'
     `--sparse'

`-T'
     `--files-from'

`-U'
     `--unlink-first'

`-V'
     `--label'

`-W'
     `--verify'

`-X'
     `--exclude-from'

`-Z'
     `--compress'

`-b'
     `--blocking-factor'

`-c'
     `--create'

`-d'
     `--compare'

`-f'
     `--file'

`-g'
     `--listed-incremental'

`-h'
     `--dereference'

`-i'
     `--ignore-zeros'

`-k'
     `--keep-old-files'

`-l'
     `--one-file-system'

`-m'
     `--touch'

`-o'
     `--portability'

`-p'
     `--preserve-permissions'

`-r'
     `--append'

`-s'
     `--same-order'

`-t'
     `--list'

`-u'
     `--update'

`-v'
     `--verbose'

`-w'
     `--interactive'

`-x'
     `--extract'

`-z'
     `--gzip'

