The files inside an archive are called "members". Within this manual, we use the term "file" to refer only to files accessible in the normal ways (by `ls', `cat', and so forth), and the term "members" to refer only to the members of an archive. Similarly, a "file name" is the name of a file, as it resides in the filesystem, and a "member name" is the name of an archive member within the archive.
Initially, `tar' archives were used to store files conveniently on magnetic tape. The name `tar' comes from this use; it stands for: `t'ape `ar'chiver. Despite the utility's name, `tar' can direct its output to any available device, as well as store it in a file or direct it to another program via a pipe. `tar' may even access, as archives, remote devices or files.
Compressed archives are recognised automatically, it is no longer necessary to specify -Z, -z, or -j options to read them. Thus, you can now run `tar tf archive.tar.gz'.
When restoring incremental dumps, --one-file-system option prevents directory hierarchies residing on different devices from being purged. With the previous versions of tar it was dangerous to create incremental dumps with --one-file-system option, since they would recursively remove mount points when restoring from the back up. This change fixes the bug.
Renamed --strip-path to --strip-components for consistency with the GNU convention.
Skipping archive members is sped up if the archive media supports seeks.
Restore script starts restoring only if it is given --all (-a) option, or some patterns. This is to prevent accidental restores.
`tar --verify' prints a warning if during archive creation some of the file names had their prefixes stripped off.
New option --exclude-caches instructs tar to exclude cache directories automatically on archive creation. Cache directories are those containing a standardized tag file, as specified at: http://www.brynosaurus.com/cachedir/spec.html
Added support for POSIX.1-2001 and ustar archive formats.
New option --format allows to select the output archive format
The default output format can be selected at configuration time by presetting the environment variable DEFAULT_ARCHIVE_FORMAT. Allowed values are GNU, V7, OLDGNU and POSIX.
New option --strip-path allows to cut off a given number of path elements from the name of the file being extracted.
New options --index-file, --no-overwrite-dir. The --overwrite-dir option is now the default; use --no-overwrite-dir if you prefer the previous default behavior.
The semantics of -o option is changed. When extracting, it does the same as --no-same-owner GNU tar option. This is compatible with UNIX98 tar. Otherwise, its effect is the same as that of --old-archive option. This latter is deprecated and will be removed in future.
New option --check-links prints a message if not all links are dumped for a file being archived. This corresponds to the UNIX98 -l option. The current semantics of the -l option is retained for compatibility with previous releases, however such usage is strongly deprecated as the option will change to its UNIX98 semantics in the future releases.
New option --occurrence[=N] can be used in conjunction with one of the subcommands --delete, --diff, --extract or --list when a list of files is given either on the command line or via -T option. This option instructs tar to process only the Nth occurrence of each named file. N defaults to 1, so `tar -x -f archive --occurrence filename' extracts the first occurrence of `filename' from `archive' and terminates without scanning to the end of the archive.
New option --pax-option allows to control the handling of POSIX keywords in `pax' extended headers. It is equivalent to `pax' -o option.
--incremental and --listed-incremental options work correctly on individual files, as well as on directories.
New scripts: backup (replaces old level-0 and level-1) and restore. The scripts are compiled and installed if --enable-backup-scripts option is given to configure.
By default tar searches "rmt" utility in "$prefix/libexec/rmt", which is consistent with the location where the version of "rmt" included in the package is installed. Previous versions of tar used "/etc/rmt". To install "rmt" to its traditional location, run configure with option --libexecdir=/etc. Otherwise, if you already have rmt installed and wish to use it, instead of the shipped in version, set the variable DEFAULT_RMT_COMMAND to the full path name of the utility, e.g. ./configure DEFAULT_RMT_COMMAND=/etc/rmt.
Notice also that the full path name of the "rmt" utility to use can be set at runtime, by giving option --rmt-command to tar. s
Removed obsolete command line options:
New options --anchored, --ignore-case, --wildcards, --wildcards-match-slash, and their negations (e.g., --no-anchored). Along with --recursion and --no-recursion, these options control how exclude patterns are interpreted.
The default interpretation of exclude patterns is now --no-anchored --no-ignore-case --recursion --wildcards --wildcards-match-slash. This is a quiet change to the semantics of --exclude. The previous semantics were a failed attempt at backward compatibility but it became clear that the semantics were puzzling and did not satisfy everybody.
gnutar --helpFor e.g. to view the contents of a gzip- respectively bzip2-compressed tar archive you may use
gnutar tvfz foo.tar.gz gnutar --use=bzip2 -tvf bar.tar.bz2
For the full documentation see the tar info pages via
texinfo --usage -f tar.infoFor just the commandline options issue the command
texinfo --usage -f tar.infoAlternatively you can see the locally
HTML-converted versionof the corresponding GNU info pages or the original GNU tar Online Manual pages.
Here a short extraction:
You can use `tar' archives in many ways. We want to stress a few of them: storage, backup or transportation.
A magnetic tape can store several files in sequence, but has no names for them, just relative position on the tape. A `tar' archive or something like it is one way to store several files on one tape and retain their names. Even when the basic transfer mechanism can keep track of names, as FTP can, the nuisance of handling multiple files, directories, and multiple links, makes `tar' archives an attractive method.
Archive files are also used for long-term storage, which you can think of as transportation from one time to another.
The GNU version of `tar' has special features that allow it to be used to make incremental and full dumps of all the files in a filesystem.
Piping one `tar' to another is an easy way to copy a directory's contents from one disk to another, while preserving the dates, modes, owners and link structure of all the files therein. `tar' is also ideal for transferring directories over networks. We sometimes see a copy of `tar' packing many files into one archive on one machine, and sending the produced archive over a pipe over the network to another copy of `tar' on another machine, reading its archive from the pipe and unpacking all files there.