GNU Tar


GNU Tar provides the ability to create tar archives, as well as various other kinds of manipulation. For example, you can use Tar on previously created archives to extract files, to store additional files, or to update or list files which were already stored.

Initially, tar archives were used to store files conveniently on magnetic tape. The name "Tar" comes from this use; it stands for tape archiver. Despite the utility's name, Tar can direct its output to available devices, files, or other programs (using pipes), it can even access remote devices or files (as archives).

Downloading Tar

Tar can be found on the main GNU ftp server: https://ftp.gnu.org/gnu/tar/ (via HTTP) and ftp://ftp.gnu.org/gnu/tar/ (via FTP). It can also be found on the GNU mirrors; please use a mirror if possible.

For information about Git access, alpha releases, patches, etc., please see the project's home page.

Documentation

Documentation for Tar is available online, as is documentation for most GNU software. You may also find more information about Tar by running info tar or man tar, or by looking at /usr/share/doc/tar/, /usr/local/doc/tar/, or similar directories on your system. A brief summary is available by running tar --help.

Mailing lists

Tar has the following mailing lists:

Announcements about Tar and most other GNU software are made on info-gnu (archive).

Security reports that should not be made immediately public can be sent directly to the maintainer. If there is no response to an urgent issue, you can escalate to the general security mailing list for advice.

Getting involved

Development of Tar, and GNU in general, is a volunteer effort, and you can contribute. For information, please read How to help GNU. If you'd like to get involved, it's a good idea to join the discussion mailing list (see above).

Test releases
Trying the latest test release (when available) is always appreciated. Test releases of Tar can be found at https://alpha.gnu.org/gnu/tar/ (via HTTP) and ftp://alpha.gnu.org/gnu/tar/ (via FTP).
Development
For development sources, issue trackers, and other information, please see the Tar project page at savannah.gnu.org.
Translating Tar
To translate Tar's messages into other languages, please see the Translation Project page for Tar. If you have a new translation of the message strings, or updates to the existing strings, please have the changes made in this repository. Only translations from this site will be incorporated into Tar. For more information, see the Translation Project.
Maintainer
Tar is currently being maintained by Jeff Bailey, Paul Eggert, and Sergey Poznyakoff. Please use the mailing lists for contact.

Licensing

Tar is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

Releases

Date Version Download (please use one of the mirrors instead) Information
2023-07-18 1.35 tar.gz; signature.
tar.bz2; signature.
tar.xz; signature. cpio.gz; signature.
  • Fail when building GNU tar, if the platform supports 64-bit time_t but the build uses only 32-bit time_t.
  • Leave the devmajor and devminor fields empty (rather than zero) for non-special files, as this is more compatible with traditional tar.

Bug fixes

  • Fix interaction of --update with --wildcards.
  • When extracting archives into an empty directory, do not create hard links to files outside that directory.
  • Handle partial reads from regular files.
  • Warn file changed as we read it less often. Formerly, tar warned if the file's size or ctime changed. However, this generated a false positive if tar read a file while another process hard-linked to it, changing its ctime. Now, tar warns if the file's size, mtime, user ID, group ID, or mode changes. Although neither heuristic is perfect, the new one should work better in practice.
  • Fix --ignore-failed-read to ignore file-changed read errors as far as exit status is concerned. You can now suppress file-changed issues entirely with --ignore-failed-read --warning=no-file-changed.
  • Fix --remove-files to not remove a file that changed while we read it.
  • Fix --atime-preserve=replace to not fail if there was no need to replace, either because we did not read the file, or the atime did not change.
  • Fix race when creating a parent directory while another process is also doing so.
  • Fix handling of prefix keywords not followed by "." in pax headers.
  • Fix handling of out-of-range sparse entries in pax headers.
  • Fix handling of --transform='s/s/@/2'.
  • Fix treatment of options ending in slash in files-from list.
  • Fix crash on tar --checkpoint-action exec=\".
  • Fix low-memory crash when reading incremental dumps.
  • Fix --exclude-vcs-ignores memory allocation misuse.
2021-02-13 1.34 tar.gz; signature.
tar.bz2; signature.
tar.xz; signature. cpio.gz; signature.
2021-01-07 1.33 tar.gz; signature.
tar.bz2; signature.
tar.xz; signature. cpio.gz; signature.
  • POSIX extended format headers do not include PID by default.
  • --delay-directory-restore works for archives with reversed member ordering.
  • Fix extraction of a symbolic link hardlinked to another symbolic link.
  • Wildcards in exclude-vcs-ignore mode don't match slash.
  • Fix the --no-overwrite-dir option.
  • Fix handling of chained renames in incremental backups.
  • Link counting works for file names supplied with -T.
  • Accept only position-sensitive (file-selection) options in file list files.
2019-02-23 1.32 tar.gz; signature.
tar.bz2; signature.
tar.xz; signature.
cpio.gz; signature.
2017-12-17 1.30 tar.gz; signature.
tar.bz2; signature.
tar.xz; signature.
cpio.gz; signature.
Member names containing '..' components are now skipped when extracting.
This fixes tar's behavior to match its documentation, and is a bit safer when extracting untrusted archives over old files (an unsafe practice that the tar manual has long recommended against).
Report erroneous use of position-sensitive options.
During archive creation or update, tar keeps track of positional options (see the manual, subsection 3.4.4 "Position-Sensitive Options"), and reports those that had no effect.
--numeric-owner now affects private headers too.
This helps the output of tar to be more deterministic.
Fixed the --delay-directory-restore option.
In some cases tar would restore the directory permissions too early, causing subsequent link extractions in that directory to fail.
The --warnings=failed-read option
This new warning control option suppresses warning messages about unreadable files and directories. It has effect only if used together with the --ignore-failed-read option.
The --warnings=none option now suppresses all warnings
This includes warnings about unreadable files produced when --ignore-failed-read is in effect. To output these, use --warnings=none --warnings=no-failed-read.
Fix reporting of hardlink mismatches during compare
Tar reported incorrect target file name in the 'Not linked to' diagnostic message.
2016-05-16 1.29 shar.gz; signature.
tar.gz; signature.
tar.bz2; signature.
tar.xz; signature.
cpio.gz; signature.
  • New options: --verbatim-files-from, --no-verbatim-files-from
  • The --null option reads file names verbatim
  • New options: --owner-map=FILE and --group-map=FILE
  • New option: --clamp-mtime
  • Deprecated --preserve option removed
  • If possible, use SEEK_DATA/SEEK_HOLE to detect sparse files.

See details.

2014-07-28 1.28 shar.gz; signature.
tar.gz; signature.
tar.bz2; signature.
tar.xz; signature.
cpio.gz; signature.
  • New checkpoint action: totals
  • Extended checkpoint format specifications
  • New option --one-top-level
  • New option --sort
  • New exclusion options
  • Refuse to read input from and write output to a tty device
  • Manpages provided

See details.

2013-11-17 1.27.1 shar.gz; signature.
tar.gz; signature.
tar.bz2; signature.
tar.xz; signature.
cpio.gz; signature.
  • Fix unquoting of file names obtained via the -T option
  • Fix GNU long link header timestamp (backward compatibility)
  • Fix extracting sparse members from star archives
2013-10-05 1.27 shar.gz; signature.
tar.gz; signature.
tar.bz2; signature.
tar.xz; signature.
cpio.gz; signature.

Please see the NEWS file for detailed information.

2011-03-13 1.26 shar.gz; signature.
tar.gz; signature.
tar.bz2; signature.
tar.xz; signature.
cpio.gz; signature.
Bugfixes
  • Fix the --verify option, which broke in version 1.24.
  • Fix storing long sparse file names in PAX archives.
  • Fix correctness of --atime-preserve=replace.
  • Work around POSIX incompatibilities on FreeBSD, NetBSD and Tru64.
  • Fix bug with --one-file-system --listed-incremental.
2010-11-07 1.25 shar.gz; signature.
tar.gz; signature.
tar.bz2; signature.
tar.xz; signature.
cpio.gz; signature.
Bugfixes
  • Fix extraction of empty directories with the -C option in effect
  • Fix extraction of device nodes
  • Make sure name matching occurs before eventual name transformation
  • Fix the behavior of tar -x --overwrite on hosts lacking O_NOFOLLOW.
  • Improve the testsuite
Alternative decompression programs

If extraction from a compressed archive fails because the corresponding compression program is not installed and the following two conditions are met, tar retries extraction using an alternative decompressor:

  1. Another compression program supported by tar is able to handle this compression format
  2. The compression program was not explicitly requested in the command line by the use of such options as -z, -j, etc.

For example, if compress is not available, tar will try gzip.

2010-10-24 1.24 shar.gz; signature.
tar.gz; signature.
tar.bz2; signature.
tar.xz; signature.
cpio.gz; signature.

See the NEWS file, for a detailed information.

  • The --full-time option
  • More reliable directory traversal when creating archives
  • --dereference consistency
  • Extracts symlink attributes, such as last-modified time and link permissions, if the operating system supports this
  • Fixed spurious error diagnostics on broken pipe
  • Fixed --remove-files bug (previous version would fail to remove a directory which contained symlinks to another files within that directory)
  • Accepts the --label option used together with --update
  • The options --record-size and --tape-length (-L) accept size suffixes
  • Fixed dead loop on extracting existing symlinks with the -k option
2010-03-10 1.23 Gzipped shell archive and its signature.
Gzipped tar archive and its signature.
Bzipped tar archive and its signature.
Gzipped cpio archive and its signature.

See the NEWS file, for a detailed information.

  • Improved record size autodetection
  • Use of lseek on seekable archives
  • New command line option --warning
  • New command line option --level
  • Improved behavior if some files were removed during incremental dumps
  • Modification times of PAX extended headers
  • Time references in the --pax-option argument
  • Augmented environment of the --to-command script
  • Bugfixes:
    • Fix handling of hard link targets by -c --transform
    • Fix hard links recognition with -c --remove-files
    • Fix restoring files from backup (debian bug #508199)
    • Correctly restore modes and permissions on existing directories
    • The --remove-files option removes files only if they were succesfully stored in the archive
    • Fix storing and listing of the volume labels in POSIX format
    • Improve algorithm for splitting long file names (ustar format)
    • Fix possible memory overflow in the rmt client code (CVE-2010-0624)
2009-03-05 1.22 Gzipped shell archive and its signature.
Gzipped tar archive and its signature.
Bzipped tar archive and its signature.
Gzipped cpio archive and its signature.
  • Support for xz compression (--xz option)
  • Short option -J is reassigned as a shortcut for --xz
  • The option -I is a shortcut for --use-compress-program
  • The --no-recursive option works with --incremental
2008-12-27 1.21 Gzipped shell archive and its signature.
Gzipped tar archive and its signature.
Bzipped tar archive and its signature.
Gzipped cpio archive and its signature.
  • New short option -J, an alias for --lzma
  • New option --lzop
  • New option --no-auto-compress,

    Cancels the effect of previous --auto-compress (-a) option

  • New option --no-null

    Cancels the effect of previous --null option.

  • Compressed format recognition

    If tar is unable to determine archive compression format, it falls back to using archive suffix to determine it.

  • VCS support

    Using --exclude-vcs handles also files used internally by Bazaar, Mercurial and Darcs.

  • Transformation scope flags

    Name transformation expressions understand additional flags that control type of archive members affected by them. The flags are:

    r
    Apply transformation to regular archive members.
    s
    Apply transformation to symbolic link targets.
    h
    Apply transformation to hard link targets.

    The corresponding upper-case letters negate the meaning, so that H means do not apply transformation to hard link targets.

    The scope flags are listed in the third part of a s expression, e.g.:

    $ tar --transform 's|^|/usr/local/|S'

    The default is rsh, which means that transformations are applied to both regular archive members and to the targets of symbolic and hard links.

    If several transform expressions are used, the default flags can be changed using flags= statement placed before the expressions, e.g.:

    $ tar --transform 'flags=S;s|^|/usr/local/|'

  • Bugfixes:
    1. The --null option disabled handling of tar options in list files. This is fixed.
    2. Fixed record size autodetection. If detected record size differs from the expected value (either default, or set on the command line), tar prints a warning if verbosity level is set to 1 or greater, i.e. if either -t or -v option is given.
2008-04-14 1.20 Gzipped shell archive and its signature.
Gzipped tar archive and its signature.
Bzipped tar archive and its signature.
Gzipped cpio archive and its signature.
  • New option --auto-compress (-a)

    With --create, selects compression algorithm basing on the suffix of the archive file name.

  • New option --lzma

    Selects LZMA compression algorithm.

  • New option --hard-dereference

    During archive creation, dereferences hard links and stores the files they refer to, instead of creating usual hard link members (type '1').

  • New option --checkpoint-action

    This action allows to specify an action to be executed upon hitting a checkpoint. Recognized actions are: dot, echo (the default), echo=string, ttyout=string, exec=cmdline, and sleep=value. Any number of --checkpoint-action options can be specified, the actions will be executed in order of their appearance in the command line. See section 3.8 "Checkpoints" for a complete description.

  • New options --no-check-device, --check-device.

    The --no-check-device option disables comparing device numbers during preparatory stage of an incremental dump. This allows to avoid creating full dumps if the device numbers change (e.g. when using an LVM snapshot).

    The --check-device option enables comparing device numbers. This is the default. This option is provided to undo the effect of the previous --no-check-device option, e.g. if it was set in TAR_OPTIONS environment variable.

  • The --transform option.

    Any number of --transform options can be given in the command line. The specified transformations will be applied in turn.

    Argument to --transform option can be a list of replace expressions, separated by a semicolon (as in sed).

    Filename transformations are applied to symbolic link targets during both creation and extraction. Tar 1.19 used them only during extraction.

    For a detailed description, see section 6.7 "Modifying File and Member Names".

  • Info (end-of-volume) scripts

    The value of the blocking factor is made available to info and checkpoint scripts via environment variable TAR_BLOCKING_FACTOR.

  • Incremental archives

    Improved (sped up) extracting from incremental archives.

  • Bugfixes.
    • Fix bug introduced in version 1.19: tar refused to update non-existing archives.
2007-10-10 1.19 Gzipped shell archive and its signature.
Gzipped tar archive and its signature.
Bzipped tar archive and its signature.
Gzipped cpio archive and its signature.
  • New option --exclude-vcs excludes directories and files, created by several widely used version control systems, e.g. CVS/, .svn/, etc.
  • The --exclude-tag* and --exclude-cache* option families work with incremental archives as well.
  • Fixed handling of renamed files in listed incremental archives.

    Previous versions always stored absolute file names in rename records, even if -P was not used. This is fixed: rename records contain file names processed in accordance with the command line settings.

  • Fixed --version output.
  • Recognition of broken archives.

    When supplied an archive smaller than 512 bytes in reading mode (-x, -t), previous tar versions silently ignored it, exiting with code 0. It is fixed. Tar now issues the following diagnostic message: This does not look like a tar archive, and exits with code 2.

  • Fix double-dot recognition in archive member names in case of duplicate /..
  • Fix file padding in case of truncation of the input file to zero size.
2007-06-29 1.18 Gzipped shell archive and its signature.
Gzipped tar archive and its signature.
Bzipped tar archive and its signature.
Gzipped cpio archive and its signature.
  • Licensed under the GPLv3.
  • Several bugs in the testsuite are fixed.
2007-06-08 1.17 Gzipped shell archive and its signature.
Gzipped tar archive and its signature.
Bzipped tar archive and its signature.
Gzipped cpio archive and its signature.
  • Fix archivation of sparse files in posix mode. Previous versions padded sparse members with spurious zero blocks.
  • Fix operation of --verify --listed-incremental. Version 1.16.1 produced a full dump when both options were given.
  • Fix --occurence. In previous versions it continued scanning the archive even though all requested members has already been extracted.
  • Scope of --transform and --strip-components options.

    In addition to affecting regular archive members, the --transform option affects hard and symbolic link targets and the --strip-components option affects hard link targets as well.

  • End-of-volume script can send the new volume name to tar by writing it to the file descriptor stored in the environment variable TAR_FD (instead of hard-coded descriptor number used in previous versions).
2006-12-09 1.16.1 Gzipped shell archive and its signature.
Gzipped tar archive and its signature.
Bzipped tar archive and its signature.
Gzipped cpio archive and its signature.
  • New option --exclude-tag allows to specify exclusion tag files, i.e. files whose presence in a directory means that the directory should not be archived.
  • The --exclude-cache option excludes directories that contain the CACHEDIR.TAG file from being archived. Previous versions excluded directory contents only, while the directories themselves were still added to the archive.
  • Support for reading ustar type N header logical records has been removed. This GNU extension was generated only by very old versions of GNU tar. Unfortunately its implementation had security holes. We don't expect that any tar archives in practical use have type N records, but if you have one and you trust its contents, you can decode it with GNU tar 1.16 or earlier.
  • Race conditions have been fixed that in some cases briefly allowed files extracted by tar -x --same-owner (or plain tar -x, when running as root) to be accessed by users that they shouldn't have been.
2006-10-21 1.16 Gzipped shell archive and its signature.
Gzipped tar archive and its signature.
Bzipped tar archive and its signature.
Gzipped cpio archive and its signature.
See NEWS file for the list of changes.
A cpio archive is provided for those who do not have tar or sharutils. To unpack it run: gzip -d -c tar-1.16.cpio.gz | cpio -i.
2006-06-16 1.15.91 Gzipped shell archive and its signature
Gzipped tar archive and its signature
Bzipped tar achive and its signature.

See announce.

2006-02-19 1.15.90 Gzipped shell archive and its signature
Gzipped tar archive and its signature
Bzipped tar achive and its signature.

Alpha release in preparation for next stable version. See its announce, for the detailed description of bug fixes and new features.

2004-12-21 1.15.1 Gzipped patch over the previous version and its signature.
Gzipped shell archive and its signature.
Gzipped tar archive and its signature.
Bzipped tar archive and its signature.

Unpacking archives piped from standard input now works correctly. This logic flaw was introduced in version 1.15 and has unfortunately passed unnoticed the pretesting phase.

If you have already downloaded version 1.15 of the package, you may wish downloading the patch, instead of getting the complete new tarball.

To apply the patch, change to the tar-1.15 directory and then use patch -p1. -p1 avoids guesswork in choosing which subdirectory to find each file in.

2004-12-20 1.15 Gzipped shell archive and its signature.
Gzipped tar archive and its signature.
Bzipped tar archive and its signature.
  • 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 and expect it to work!
  • When restoring incremental dumps, --one-file-system option prevents directory hierarchies residing on different devices from being purged.
  • --strip-path option renamed to --strip-components.
  • Restore script starts restoring only if it is given --all (-a) option or some patterns. This prevents 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.
See NEWS for more detailed information.
2004-09-02 1.14.90 Gzipped shell archive
Gzipped tar archive
Bzipped tar archive
An alpha release fixing bugs found in version 1.14. See the list of user-visible changes and ChangeLog diff for detailed information.
2004-05-10 1.14 Gzipped shell archive
Gzipped tar archive
Bzipped tar archive
First major release since 1999. See NEWS, and ChangeLog for details.