tar - an archiving utility
tar
{A|c|d|r|t|u|x}[GnSkUWOmpsMBiajJzZhPlRvwo]
[ARG
...]
tar -A [OPTIONS
]
-f ARCHIVE
ARCHIVE
...
tar -c [-f
ARCHIVE
] [OPTIONS
] [FILE
...]
tar -d [-f
ARCHIVE
] [OPTIONS
] [FILE
...]
tar -r [-f
ARCHIVE
] [OPTIONS
] [FILE
...]
tar -t [-f
ARCHIVE
] [OPTIONS
] [MEMBER
...]
tar -u [-f
ARCHIVE
] [OPTIONS
] [FILE
...]
tar -x [-f
ARCHIVE
] [OPTIONS
] [MEMBER
...]
tar
{--catenate|--concatenate}
[OPTIONS
] --file ARCHIVE
ARCHIVE
...
tar --create
[--file ARCHIVE
] [OPTIONS
]
[FILE
...]
tar
{--diff|--compare}
[--file ARCHIVE
] [OPTIONS
]
[FILE
...]
tar --delete
[--file ARCHIVE
] [OPTIONS
]
[MEMBER
...]
tar --append
[--file ARCHIVE
] [OPTIONS
]
[FILE
...]
tar --list [--file
ARCHIVE
] [OPTIONS
] [MEMBER
...]
tar --test-label
[--file ARCHIVE
] [OPTIONS
]
[LABEL
...]
tar --update
[--file ARCHIVE
] [OPTIONS
]
[FILE
...]
tar
{--extract|--get}
[--file ARCHIVE
] [OPTIONS
]
[MEMBER
...]
This manpage is a short description of GNU tar. For a detailed discussion, including examples and usage recommendations, refer to the GNU Tar Manual available in texinfo format. If the info reader and the tar documentation are properly installed on your system, the command
info tar
should give you access to the complete manual.
You can also view the manual using the info mode in emacs(1), or find it in various formats online at
If any discrepancies occur between this manpage and the GNU Tar Manual, the later shall be considered the authoritative source.
GNU tar is an archiving program designed to store multiple files in a single file (an archive), and to manipulate such archives. The archive can be either a regular file or a device (e.g. a tape drive, hence the name of the program, which stands for tape archiver), which can be located either on the local or on a remote machine.
Options to GNU tar can be given in three different styles. In traditional style, the first argument is a cluster of option letters and all subsequent arguments supply arguments to those options that require them. The arguments are read in the same order as the option letters. Any command line words that remain after all options have been processed are treated as non-option arguments: file or archive member names.
For example, the c option requires creating the archive, the v option requests the verbose operation, and the f option takes an argument that sets the name of the archive to operate upon. The following command, written in the traditional style, instructs tar to store all files from the directory /etc into the archive file etc.tar, verbosely listing the files being archived:
tar cfv etc.tar /etc
In UNIX or short-option style, each option letter is prefixed with a single dash, as in other command line utilities. If an option takes an argument, the argument follows it, either as a separate command line word, or immediately following the option. However, if the option takes an optional argument, the argument must follow the option letter without any intervening whitespace, as in -g/tmp/snar.db.
Any number of options not taking arguments can be clustered together after a single dash, e.g. -vkp. An option that takes an argument (whether mandatory or optional) can appear at the end of such a cluster, e.g. -vkpf a.tar.
The example command above written in the short-option style could look like:
tar -cvf etc.tar /etc
or
tar -c -v -f etc.tar /etc
In GNU or long-option style, each option begins with two dashes and has a meaningful name, consisting of lower-case letters and dashes. When used, the long option can be abbreviated to its initial letters, provided that this does not create ambiguity. Arguments to long options are supplied either as a separate command line word, immediately following the option, or separated from the option by an equals sign with no intervening whitespace. Optional arguments must always use the latter method.
Here are several ways of writing the example command in this style:
tar --create --file etc.tar --verbose /etc
or (abbreviating some options):
tar --cre --file=etc.tar --verb /etc
The options in all three styles can be intermixed, although doing so with old options is not encouraged.
The options listed in the table below tell GNU tar what operation it is to perform. Exactly one of them must be given. The meaning of non-option arguments depends on the operation mode requested.
Append archives to the end of another archive. The arguments are treated as the names of archives to append. All archives must be of the same format as the archive they are appended to, otherwise the resulting archive might be unusable with non-GNU implementations of tar. Notice also that when more than one archive is given, the members from archives other than the first one will be accessible in the resulting archive only when using the -i (--ignore-zeros) option.
Compressed archives cannot be concatenated.
Create a new archive. Arguments supply the names of the files to be archived. Directories are archived recursively, unless the --no-recursion option is given.
Find differences between archive and file system. The arguments are optional and specify archive members to compare. If not given, the current working directory is assumed.
Delete from the archive. The arguments supply names of the archive members to be removed. At least one argument must be given.
This option does not operate on compressed archives. There is no short option equivalent.
Append files to the end of an archive. Arguments have the same meaning as for -c (--create).
List the contents of an archive. Arguments are optional. When given, they specify the names of the members to list.
Test the archive volume label and exit. When used without arguments, it prints the volume label (if any) and exits with status 0. When one or more command line arguments are given. tar compares the volume label with each argument. It exits with code 0 if a match is found, and with code 1 otherwise. No output is displayed, unless used together with the -v (--verbose) option.
There is no short option equivalent for this option.
Append files which are newer than the corresponding copy in the archive. Arguments have the same meaning as with the -c and -r options. Notice, that newer files don't replace their old archive copies, but instead are appended to the end of archive. The resulting archive can thus contain several members of the same name, corresponding to various versions of the same file.
Extract files from an archive. Arguments are optional. When given, they specify names of the archive members to be extracted.
Show built-in defaults for various tar options and exit.
Display a short option summary and exit.
Display a list of available options and exit.
Print program version and copyright information and exit.
Check device numbers when creating incremental archives (default).
FILE
Handle new GNU-format incremental backups. FILE
is the name
of a snapshot file, where tar stores
additional information which is used to decide which files changed since
the previous incremental dump and, consequently, must be dumped again.
If FILE
does not exist when creating an archive, it will be
created and all files will be added to the resulting archive (the
level 0 dump). To create incremental archives of
non-zero level N, you need a copy of the snapshot file
created for level N-1, and use it as FILE
.
When listing or extracting, the actual content of FILE
is
not inspected, it is needed only due to syntactical requirements. It is
therefore common practice to use /dev/null in its
place.
METHOD
Use METHOD
to detect holes in sparse files. This option
implies --sparse. Valid values for METHOD
are
seek and raw. Default is
seek with fallback to raw when not
applicable.
Handle old GNU-format incremental backups.
Do not exit with nonzero on unreadable files.
NUMBER
Set dump level for a created listed-incremental archive. Currently only --level=0 is meaningful: it instructs tar to truncate the snapshot file before dumping, thereby forcing a level 0 dump.
Assume the archive is seekable. Normally tar determines automatically whether the archive can be seeked or not. This option is intended for use in cases when such recognition fails. It takes effect only if the archive is open for reading (e.g. with --list or --extract options).
Do not check device numbers when creating incremental archives.
Assume the archive is not seekable.
N
]Process only the N
th occurrence of each file in the archive.
This option is valid only when used with one of the following
subcommands: --delete, --diff,
--extract or --list and when a list of
files is given either on the command line or via the -T
option. The default N
is 1.
Disable the use of some potentially harmful options.
MAJOR
[.MINOR
]Set which version of the sparse format to use. This option implies --sparse. Valid argument values are 0.0, 0.1, and 1.0. For a detailed discussion of sparse formats, refer to the GNU Tar Manual, appendix D, "Sparse Formats". Using the info reader, it can be accessed running the following command: info tar 'Sparse Formats'.
Handle sparse files efficiently. Some files in the file system may have segments which were actually never written (quite often these are database files created by such systems as DBM). When given this option, tar attempts to determine if the file is sparse prior to archiving it, and if so, to reduce the resulting archive size by not dumping empty parts of the file.
These options control tar actions when extracting a file over an existing copy on disk.
Don't replace existing files when extracting.
Don't replace existing files that are newer than their archive copies.
Don't replace existing symlinks to directories when extracting.
Preserve metadata of existing directories.
DIR
]Extract all files into DIR
, or, if used without argument,
into a subdirectory named by the base name of the archive (minus
standard compression suffixes recognizable by
--auto-compress).
Overwrite existing files when extracting.
Overwrite metadata of existing directories when extracting (default).
Recursively remove all files in the directory prior to extracting it.
Remove files from disk after adding them to the archive.
Don't replace existing files when extracting, silently skip over them.
Remove each file prior to extracting over it.
Verify the archive after writing it.
Ignore subprocess exit codes.
Treat non-zero exit codes of children as error (default).
Extract files to standard output.
COMMAND
Pipe extracted files to COMMAND
. The argument is the
pathname of an external program, optionally with command line arguments.
The program will be invoked and the contents of the file being extracted
supplied to it on its standard input. Additional data will be supplied
via the following environment variables:
Type of the file. It is a single letter with the following meaning:
f Regular file
d Directory
l Symbolic link
h Hard link
b Block device
c Character device
Currently only regular files are supported.
File mode, an octal number.
The name of the file.
Name of the file as stored in the archive.
Name of the file owner.
Name of the file owner group.
Time of last access. It is a decimal number, representing seconds since the Epoch. If the archive provides times with nanosecond precision, the nanoseconds are appended to the timestamp after a decimal point.
Time of last modification.
Time of last status change.
Size of the file.
UID of the file owner.
GID of the file owner.
Additionally, the following variables contain information about tar operation mode and the archive being processed:
GNU tar version number.
The name of the archive tar is processing.
Current blocking factor, i.e. number of 512-byte blocks in a record.
Ordinal number of the volume tar is processing (set if reading a multi-volume archive).
Format of the archive being processed. One of: gnu, oldgnu, posix, ustar, v7.
A short option (with a leading dash) describing the operation tar is executing.
METHOD
]Preserve access times on dumped files, either by restoring the times
after reading (METHOD
=replace, this is the
default) or by not setting the times in the first place
(METHOD
=system).
Delay setting modification times and permissions of extracted directories until the end of extraction. Use this option when extracting from an archive which has unusual member ordering.
NAME
[:GID
]Force NAME
as group for added files. If GID
is not
supplied, NAME
can be either a user name or numeric GID. In
this case the missing part (GID or name) will be inferred from the
current host's group database.
When used with --group-map=FILE
, affects
only those files whose owner group is not listed in FILE
.
FILE
Read group translation map from FILE
. Empty lines are
ignored. Comments are introduced with # sign and extend
to the end of line. Each non-empty line in FILE
defines
translation for a single group. It must consist of two fields, delimited
by any amount of whitespace:
OLDGRP NEWGRP[:NEWGID]
OLDGRP
is either a valid group name or a GID prefixed with
+. Unless NEWGID
is supplied, NEWGRP
must also be either a valid group name or a
+GID
. Otherwise, both NEWGRP
and
NEWGID
need not be listed in the system group database.
As a result, each input file with owner group OLDGRP
will be
stored in archive with owner group NEWGRP
and GID
NEWGID
.
CHANGES
Force symbolic mode CHANGES
for added files.
DATE-OR-FILE
Set mtime for added files. DATE-OR-FILE
is either a
date/time in almost arbitrary format, or the name of an existing file.
In the latter case the mtime of that file will be used.
Don't extract file modified time.
Cancel the effect of the prior --delay-directory-restore option.
Extract files as yourself (default for ordinary users).
Apply the user's umask when extracting permissions from the archive (default for ordinary users).
Always use numbers for user/group names.
NAME
[:UID
]Force NAME
as owner for added files. If UID
is not
supplied, NAME
can be either a user name or numeric UID. In
this case the missing part (UID or name) will be inferred from the
current host's user database.
When used with --owner-map=FILE
, affects
only those files whose owner is not listed in FILE
.
FILE
Read owner translation map from FILE
. Empty lines are
ignored. Comments are introduced with # sign and extend
to the end of line. Each non-empty line in FILE
defines
translation for a single UID. It must consist of two fields, delimited
by any amount of whitespace:
OLDUSR NEWUSR[:NEWUID]
OLDUSR
is either a valid user name or a UID prefixed with
+. Unless NEWUID
is supplied, NEWUSR
must also be either a valid user name or a
+UID
. Otherwise, both NEWUSR
and
NEWUID
need not be listed in the system user database.
As a result, each input file owned by OLDUSR
will be stored
in archive with owner name NEWUSR
and UID NEWUID
.
Set permissions of extracted files to those recorded in the archive (default for superuser).
Try extracting files with the same ownership as exists in the archive (default for superuser).
Tell tar that the list of file names to process is sorted in the same order as the files in the archive.
ORDER
When creating an archive, sort directory entries according to
ORDER
, which is one of none,
name, or inode.
The default is --sort=none, which stores archive members in the same order as returned by the operating system.
Using --sort=name ensures the member ordering in the created archive is uniform and reproducible.
Using --sort=inode reduces the number of disk seeks made when creating the archive and thus can considerably speed up archivation. This sorting order is supported only if the underlying system provides the necessary information.
Enable POSIX ACLs support.
Disable POSIX ACLs support.
Enable SELinux context support.
Disable SELinux context support.
Enable extended attributes support.
Disable extended attributes support.
PATTERN
Specify the exclude pattern for xattr keys. PATTERN
is a
globbing pattern, e.g. --xattrs-exclude='user.*' to
include only attributes from the user namespace.
PATTERN
Specify the include pattern for xattr keys. PATTERN
is a
globbing pattern.
ARCHIVE
Use archive file or device ARCHIVE
. If this option is not
given, tar will first examine the environment variable
`TAPE'. If it is set, its value will be used as the archive name.
Otherwise, tar will assume the compiled-in default. The
default value can be inspected either using the
--show-defaults option, or at the end of the
tar --help output.
An archive name that has a colon in it specifies a file or device on a remote machine. The part before the colon is taken as the machine name or IP address, and the part after it as the file or device pathname, e.g.:
--file=remotehost:/dev/sr0
An optional username can be prefixed to the hostname, placing a @ sign between them.
By default, the remote host is accessed via the rsh(1) command. Nowadays it is common to use ssh(1) instead. You can do so by giving the following command line option:
--rsh-command=/usr/bin/ssh
The remote machine should have the rmt(8) command installed. If its pathname does not match tar's default, you can inform tar about the correct pathname using the --rmt-command option.
Archive file is local even if it has a colon.
COMMAND
,
--new-volume-script=COMMAND
Run COMMAND
at the end of each tape (implies
-M). The command can include arguments. When started,
it will inherit tar's environment plus the following
variables:
GNU tar version number.
The name of the archive tar is processing.
Current blocking factor, i.e. number of 512-byte blocks in a record.
Ordinal number of the volume tar is processing (set if reading a multi-volume archive).
Format of the archive being processed. One of: gnu, oldgnu, posix, ustar, v7.
A short option (with a leading dash) describing the operation tar is executing.
File descriptor which can be used to communicate the new volume name to tar.
If the info script fails, tar exits; otherwise, it begins writing the next volume.
N
Change tape after writing N
x1024 bytes. If N
is
followed by a size suffix (see the subsection Size
suffixes below), the suffix specifies the multiplicative factor
to be used instead of 1024.
This option implies -M.
Create/list/extract multi-volume archive.
COMMAND
Use COMMAND
instead of rmt when accessing
remote archives. See the description of the -f option,
above.
COMMAND
Use COMMAND
instead of rsh when accessing
remote archives. See the description of the -f option,
above.
FILE
When this option is used in conjunction with
--multi-volume, tar will keep track of
which volume of a multi-volume archive it is working in
FILE
.
BLOCKS
Set record size to BLOCKS
x512 bytes.
When listing or extracting, accept incomplete input records after end-of-file marker.
Ignore zeroed blocks in archive. Normally two consecutive 512-blocks filled with zeroes mean EOF and tar stops reading after encountering them. This option instructs it to read further and is useful when reading archives created with the -A option.
NUMBER
Set record size. NUMBER
is the number of bytes per record.
It must be multiple of 512. It can can be suffixed with
a size suffix, e.g. --record-size=10K,
for 10 Kilobytes. See the subsection Size suffixes, for
a list of valid suffixes.
FORMAT
Create archive of the given format. Valid formats are:
GNU tar 1.13.x format
GNU format as per tar <= 1.12.
POSIX 1003.1-2001 (pax) format.
POSIX 1003.1-1988 (ustar) format.
Old V7 tar format.
Same as --format=v7.
keyword
[[:]=value
][,keyword
[[:]=value
]]...Control pax keywords when creating PAX archives (-H pax). This option is equivalent to the -o option of the pax(1) utility.
Same as --format=posix.
TEXT
Create archive with volume name TEXT
. If listing or
extracting, use TEXT
as a globbing pattern for volume name.
Use archive suffix to determine the compression program.
=COMMAND
Filter data through COMMAND
. It must accept the
-d option, for decompression. The argument can contain
command line options.
Filter the archive through bzip2(1).
Filter the archive through xz(1).
Filter the archive through lzip(1).
Filter the archive through lzma(1).
Filter the archive through lzop(1).
Do not use archive suffix to determine the compression program.
Filter the archive through gzip(1).
Filter the archive through compress(1).
Filter the archive through zstd(1).
FILE
Add FILE
to the archive (useful if its name starts with a
dash).
CONTROL
]Backup before removal. The CONTROL
argument, if supplied,
controls the backup policy. Its valid values are:
Never make backups.
Make numbered backups.
Make numbered backups if numbered backups exist, simple backups otherwise.
Always make simple backups
If CONTROL
is not given, the value is taken from the
VERSION_CONTROL environment variable. If it is not set,
existing is assumed.
DIR
Change to DIR
before performing any operations. This option
is order-sensitive, i.e. it affects all options that follow.
PATTERN
Exclude files matching PATTERN
, a
glob(3)-style wildcard pattern.
Exclude backup and lock files.
Exclude contents of directories containing file CACHEDIR.TAG, except for the tag file itself.
Exclude directories containing file CACHEDIR.TAG and the file itself.
Exclude everything under directories containing CACHEDIR.TAG
FILE
Before dumping a directory, see if it contains FILE
. If so,
read exclusion patterns from this file. The patterns affect only the
directory itself.
FILE
Same as --exclude-ignore, except that patterns from
FILE
affect both the directory and all its subdirectories.
FILE
Exclude contents of directories containing FILE
, except for
FILE
itself.
FILE
Exclude directories containing FILE
.
FILE
Exclude everything under directories containing FILE
.
Exclude version control system directories.
Exclude files that match patterns read from VCS-specific ignore files. Supported files are: .cvsignore, .gitignore, .bzrignore, and .hgignore.
Follow symlinks; archive and dump the files they point to.
Follow hard links; archive and dump the files they refer to.
MEMBER
Begin at the given member in the archive.
DATE
Work on files whose data changed after the DATE
. If
DATE
starts with / or . it is
taken to be a file name; the mtime of that file is used as the date.
Disable the effect of the previous --null option.
Avoid descending automatically in directories.
Do not unquote input file or member names.
Treat each line read from a file list as if it were supplied in the command line. I.e., leading and trailing whitespace is removed and, if the resulting string begins with a dash, it is treated as tar command line option.
This is the default behavior. The --no-verbatim-files-from option is provided as a way to restore it after --verbatim-files-from option.
This option is positional: it affects all --files-from options that occur after it in, until --verbatim-files-from option or end of line, whichever occurs first.
It is implied by the --no-null option.
Instruct subsequent -T options to read null-terminated names verbatim (disables special handling of names that start with a dash).
See also --verbatim-files-from.
DATE
,
--after-date=DATE
Only store files newer than DATE. If DATE
starts with
/ or . it is taken to be a file name;
the mtime of that file is used as the date.
Stay in local file system when creating archive.
Don't strip leading slashes from file names when creating archives.
Recurse into directories (default).
STRING
Backup before removal, override usual suffix. Default suffix is ~, unless overridden by environment variable SIMPLE_BACKUP_SUFFIX.
FILE
Get names to extract or create from FILE
.
Unless specified otherwise, the FILE
must contain a list of
names separated by ASCII LF (i.e. one name per line).
The names read are handled the same way as command line arguments. They
undergo quote removal and word splitting, and any string that starts
with a - is handled as tar command
line option.
If this behavior is undesirable, it can be turned off using the --verbatim-files-from option.
The --null option instructs tar
that the names in FILE
are separated by ASCII
NUL character, instead of LF. It is
useful if the list is generated by find(1)
-print0 predicate.
Unquote file or member names (default).
Treat each line obtained from a file list as a file name, even if it starts with a dash. File lists are supplied with the --files-from (-T) option. The default behavior is to handle names supplied in file lists as if they were typed in the command line, i.e. any names starting with a dash are treated as tar options. The --verbatim-files-from option disables this behavior.
This option affects all --files-from options that occur after it in the command line. Its effect is reverted by the --no-verbatim-files-from option.
This option is implied by the --null option.
See also --add-file.
FILE
Exclude files matching patterns listed in FILE.
NUMBER
Strip NUMBER
leading components from file names on
extraction.
EXPRESSION
,
--xform=EXPRESSION
Use sed replace EXPRESSION
to transform file names.
These options affect both exclude and include patterns.
Patterns match file name start.
Ignore case.
Patterns match after any / (default for exclusion).
Case sensitive matching (default).
Verbatim string matching.
Wildcards do not match /.
Use wildcards (default for exclusion).
Wildcards match / (default for exclusion).
N
]Display progress messages every N
th record (default 10).
ACTION
Run ACTION
on each checkpoint.
Only set time when the file is more recent than what was given with --mtime.
Print file time to its full resolution.
FILE
Send verbose output to FILE
.
Print a message if not all links are dumped.
STRING
Disable quoting for characters from STRING
.
STRING
Additionally quote characters from STRING
.
STYLE
Set quoting style for file and member names. Valid values for
STYLE
are literal, shell,
shell-always, c,
c-maybe, escape,
locale, clocale.
Show block number within archive with each message.
When listing or extracting, list each directory that does not match search criteria.
Show file or archive names after transformation by --strip and --transform options.
SIGNAL
]Print total bytes after processing the archive. If SIGNAL
is
given, print total bytes when this signal is delivered. Allowed signals
are: SIGHUP, SIGQUIT,
SIGINT, SIGUSR1, and
SIGUSR2. The SIG prefix can be
omitted.
Print file modification times in UTC.
Verbosely list files processed. Each instance of this option on the command line increases the verbosity level by one. The maximum verbosity level is 3. For a detailed discussion of how various verbosity levels affect tar's output, please refer to GNU Tar Manual, subsection 2.5.2 "The '--verbose' Option".
KEYWORD
Enable or disable warning messages identified by KEYWORD
.
The messages are suppressed if KEYWORD
is prefixed with
no- and enabled otherwise.
Multiple --warning options accumulate.
Keywords controlling general tar operation:
Enable all warning messages. This is the default.
Disable all warning messages.
"%s: file name read contains nul character"
"A lone zero block at %s"
Keywords applicable for tar --create:
"%s: contains a cache directory tag %s; %s"
"%s: File shrank by %s bytes; padding with zeros"
"%s: file is on a different filesystem; not dumped"
"%s: Unknown file type; file ignored"
"%s: socket ignored"
"%s: door ignored"
"%s: file is unchanged; not dumped"
"%s: archive cannot contain itself; not dumped"
"%s: File removed before we read it"
"%s: file changed as we read it"
Suppresses warnings about unreadable files or directories. This keyword applies only if used together with the --ignore-failed-read option.
Keywords applicable for tar --extract:
"%s: skipping existing file"
"%s: implausibly old time stamp %s"
"%s: time stamp %s is %s s in the future"
"Extracting contiguous files as regular files"
"Attempting extraction of symbolic links as hard links"
"%s: Unknown file type '%c', extracted as normal file"
"Current %s is newer or same age"
"Ignoring unknown extended header keyword '%s'"
Controls verbose description of failures occurring when trying to run alternative decompressor programs. This warning is disabled by default (unless --verbose is used). A common example of what you can get when using this warning is:
$ tar --warning=decompress-program -x -f archive.Z
tar (child): cannot run compress: No such file or directory
tar (child): trying gzip
This means that tar first tried to decompress archive.Z using compress, and, when that failed, switched to gzip.
"Record size = %lu blocks"
Keywords controlling incremental extraction:
"%s: Directory has been renamed from %s"
"%s: Directory has been renamed"
"%s: Directory is new"
"%s: directory is on a different device: not purging"
"Malformed dumpdir: 'X' never used"
Ask for confirmation for every action.
When creating, same as --old-archive. When extracting, same as --no-same-owner.
Suffix Units Byte Equivalent
b Blocks SIZE x 512
B Kilobytes SIZE x 1024
c Bytes SIZE
G Gigabytes SIZE x 1024^3
K Kilobytes SIZE x 1024
k Kilobytes SIZE x 1024
M Megabytes SIZE x 1024^2
P Petabytes SIZE x 1024^5
T Terabytes SIZE x 1024^4
w Words SIZE x 2
Tar's exit code indicates whether it was able to successfully perform the requested operation, and if not, what kind of error occurred.
Successful termination.
Some files differ.
If tar was invoked with
the --compare (--diff,
-d) command line option, this means that some files in
the archive differ from their disk counterparts. If tar
was given one of the --create,
--append or --update options, this
exit code means that some files were changed while being archived and so
the resulting archive does not contain the exact copy of the file
set.
Fatal error.
This means that some fatal, unrecoverable error
occurred.
If a subprocess that had been invoked by tar exited with a nonzero exit code, tar itself exits with that code as well. This can happen, for example, if a compression option (e.g. -z) was used and the external compressor program failed. Another example is rmt failure during backup to a remote device.
Report bugs to <bug-tar@gnu.org>.
Copyright © 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.