e6f5bb4
.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.43.3.
e6f5bb4
.TH TAR "1" "November 2013" "tar 1.27.1" "User Commands"
dac2710
.SH NAME
e6f5bb4
tar \- manual page for tar 1.27.1
dac2710
.SH SYNOPSIS
dac2710
.B tar
dac2710
[\fIOPTION\fR...] [\fIFILE\fR]...
dac2710
.SH DESCRIPTION
e6f5bb4
GNU 'tar' saves many files together into a single tape or disk archive, and can
dac2710
restore individual files from the archive.
dac2710
.SH EXAMPLES
dac2710
.TP
e6f5bb4
tar \-cf archive.tar foo bar
dac2710
# Create archive.tar from files foo and bar.
dac2710
.TP
e6f5bb4
tar \-tvf archive.tar
dac2710
# List all files in archive.tar verbosely.
dac2710
.TP
e6f5bb4
tar \-xf archive.tar
dac2710
# Extract all files from archive.tar.
dac2710
.IP
dac2710
Main operation mode:
dac2710
.TP
e6f5bb4
\-A, \-\-catenate, \-\-concatenate
dac2710
append tar files to an archive
dac2710
.TP
e6f5bb4
\-c, \-\-create
dac2710
create a new archive
dac2710
.TP
e6f5bb4
\-d, \-\-diff, \-\-compare
dac2710
find differences between archive and file system
dac2710
.TP
e6f5bb4
\-\-delete
dac2710
delete from the archive (not on mag tapes!)
dac2710
.TP
e6f5bb4
\-r, \-\-append
dac2710
append files to the end of an archive
dac2710
.TP
e6f5bb4
\-t, \-\-list
dac2710
list the contents of an archive
dac2710
.TP
e6f5bb4
\-\-test\-label
dac2710
test the archive volume label and exit
dac2710
.TP
e6f5bb4
\-u, \-\-update
dac2710
only append files newer than copy in archive
dac2710
.TP
e6f5bb4
\-x, \-\-extract, \-\-get
dac2710
extract files from an archive
dac2710
.IP
dac2710
Operation modifiers:
dac2710
.TP
e6f5bb4
\-\-check\-device
dac2710
check device numbers when creating incremental
dac2710
archives (default)
dac2710
.TP
e6f5bb4
\-g, \-\-listed\-incremental=FILE
dac2710
handle new GNU\-format incremental backup
dac2710
.TP
e6f5bb4
\-G, \-\-incremental
dac2710
handle old GNU\-format incremental backup
dac2710
.TP
e6f5bb4
\-\-ignore\-failed\-read
dac2710
do not exit with nonzero on unreadable files
dac2710
.TP
e6f5bb4
\-\-level=NUMBER
dac2710
dump level for created listed\-incremental archive
dac2710
.TP
e6f5bb4
\-n, \-\-seek
dac2710
archive is seekable
dac2710
.TP
e6f5bb4
\-\-no\-check\-device
dac2710
do not check device numbers when creating
dac2710
incremental archives
dac2710
.TP
e6f5bb4
\-\-no\-seek
dac2710
archive is not seekable
dac2710
.TP
e6f5bb4
\-\-occurrence[=NUMBER]
dac2710
process only the NUMBERth occurrence of each file
dac2710
in the archive; this option is valid only in
e6f5bb4
conjunction with one of the subcommands \-\-delete,
e6f5bb4
\-\-diff, \-\-extract or \-\-list and when a list of
dac2710
files is given either on the command line or via
e6f5bb4
the \-T option; NUMBER defaults to 1
dac2710
.TP
e6f5bb4
\-\-sparse\-version=MAJOR[.MINOR]
dac2710
set version of the sparse format to use (implies
e6f5bb4
\-\-sparse)
dac2710
.TP
e6f5bb4
\-S, \-\-sparse
dac2710
handle sparse files efficiently
dac2710
.IP
dac2710
Overwrite control:
dac2710
.TP
e6f5bb4
\-k, \-\-keep\-old\-files
dac2710
don't replace existing files when extracting,
dac2710
treat them as errors
dac2710
.TP
e6f5bb4
\-\-keep\-directory\-symlink
e6f5bb4
preserve existing symlinks to directories when
e6f5bb4
extracting
e6f5bb4
.TP
e6f5bb4
\-\-keep\-newer\-files
dac2710
don't replace existing files that are newer than
dac2710
their archive copies
dac2710
.TP
e6f5bb4
\-\-no\-overwrite\-dir
dac2710
preserve metadata of existing directories
dac2710
.TP
e6f5bb4
\-\-overwrite
dac2710
overwrite existing files when extracting
dac2710
.TP
e6f5bb4
\-\-overwrite\-dir
dac2710
overwrite metadata of existing directories when
dac2710
extracting (default)
dac2710
.TP
e6f5bb4
\-\-recursive\-unlink
dac2710
empty hierarchies prior to extracting directory
dac2710
.TP
e6f5bb4
\-\-remove\-files
dac2710
remove files after adding them to the archive
dac2710
.TP
e6f5bb4
\-\-skip\-old\-files
dac2710
don't replace existing files when extracting,
dac2710
silently skip over them
dac2710
.TP
e6f5bb4
\-U, \-\-unlink\-first
dac2710
remove each file prior to extracting over it
dac2710
.TP
e6f5bb4
\-W, \-\-verify
dac2710
attempt to verify the archive after writing it
dac2710
.IP
dac2710
Select output stream:
dac2710
.HP
e6f5bb4
\-\-ignore\-command\-error ignore exit codes of children
dac2710
.TP
e6f5bb4
\-\-no\-ignore\-command\-error
dac2710
treat non\-zero exit codes of children as
dac2710
error
dac2710
.TP
e6f5bb4
\-O, \-\-to\-stdout
dac2710
extract files to standard output
dac2710
.TP
e6f5bb4
\-\-to\-command=COMMAND
dac2710
pipe extracted files to another program
dac2710
.IP
dac2710
Handling of file attributes:
dac2710
.TP
e6f5bb4
\-\-atime\-preserve[=METHOD]
dac2710
preserve access times on dumped files, either
dac2710
by restoring the times after reading
dac2710
(METHOD='replace'; default) or by not setting the
dac2710
times in the first place (METHOD='system')
dac2710
.TP
e6f5bb4
\-\-delay\-directory\-restore
dac2710
delay setting modification times and
dac2710
permissions of extracted directories until the end
dac2710
of extraction
dac2710
.TP
e6f5bb4
\-\-group=NAME
dac2710
force NAME as group for added files
dac2710
.TP
e6f5bb4
\-\-mode=CHANGES
dac2710
force (symbolic) mode CHANGES for added files
dac2710
.TP
e6f5bb4
\-\-mtime=DATE\-OR\-FILE
dac2710
set mtime for added files from DATE\-OR\-FILE
dac2710
.TP
e6f5bb4
\-m, \-\-touch
dac2710
don't extract file modified time
dac2710
.TP
e6f5bb4
\-\-no\-delay\-directory\-restore
e6f5bb4
cancel the effect of \-\-delay\-directory\-restore
dac2710
option
dac2710
.TP
e6f5bb4
\-\-no\-same\-owner
dac2710
extract files as yourself (default for ordinary
dac2710
users)
dac2710
.TP
e6f5bb4
\-\-no\-same\-permissions
dac2710
apply the user's umask when extracting permissions
dac2710
from the archive (default for ordinary users)
dac2710
.TP
e6f5bb4
\-\-numeric\-owner
dac2710
always use numbers for user/group names
dac2710
.TP
e6f5bb4
\-\-owner=NAME
dac2710
force NAME as owner for added files
dac2710
.TP
e6f5bb4
\-p, \-\-preserve\-permissions, \-\-same\-permissions
dac2710
extract information about file permissions
dac2710
(default for superuser)
dac2710
.TP
e6f5bb4
\-\-preserve
e6f5bb4
same as both \-p and \-s
dac2710
.TP
e6f5bb4
\-\-same\-owner
dac2710
try extracting files with the same ownership as
dac2710
exists in the archive (default for superuser)
dac2710
.TP
e6f5bb4
\-s, \-\-preserve\-order, \-\-same\-order
e6f5bb4
member arguments are listed in the same order as
e6f5bb4
the files in the archive
dac2710
.IP
dac2710
Handling of extended file attributes:
dac2710
.TP
e6f5bb4
\-\-acls
dac2710
Enable the POSIX ACLs support
dac2710
.TP
e6f5bb4
\-\-no\-acls
dac2710
Disable the POSIX ACLs support
dac2710
.TP
e6f5bb4
\-\-no\-selinux
dac2710
Disable the SELinux context support
dac2710
.TP
e6f5bb4
\-\-no\-xattrs
dac2710
Disable extended attributes support
dac2710
.TP
e6f5bb4
\-\-selinux
dac2710
Enable the SELinux context support
dac2710
.TP
e6f5bb4
\-\-xattrs
dac2710
Enable extended attributes support
dac2710
.TP
e6f5bb4
\-\-xattrs\-exclude=MASK
dac2710
specify the exclude pattern for xattr keys
dac2710
.TP
e6f5bb4
\-\-xattrs\-include=MASK
dac2710
specify the include pattern for xattr keys
dac2710
.IP
dac2710
Device selection and switching:
dac2710
.TP
e6f5bb4
\-f, \-\-file=ARCHIVE
dac2710
use archive file or device ARCHIVE
dac2710
.TP
e6f5bb4
\-\-force\-local
dac2710
archive file is local even if it has a colon
dac2710
.TP
e6f5bb4
\-F, \-\-info\-script=NAME, \-\-new\-volume\-script=NAME
e6f5bb4
run script at end of each tape (implies \-M)
dac2710
.TP
e6f5bb4
\-L, \-\-tape\-length=NUMBER
dac2710
change tape after writing NUMBER x 1024 bytes
dac2710
.TP
e6f5bb4
\-M, \-\-multi\-volume
dac2710
create/list/extract multi\-volume archive
dac2710
.TP
e6f5bb4
\-\-rmt\-command=COMMAND
dac2710
use given rmt COMMAND instead of rmt
dac2710
.TP
e6f5bb4
\-\-rsh\-command=COMMAND
dac2710
use remote COMMAND instead of rsh
dac2710
.TP
e6f5bb4
\-\-volno\-file=FILE
dac2710
use/update the volume number in FILE
dac2710
.IP
dac2710
Device blocking:
dac2710
.TP
e6f5bb4
\-b, \-\-blocking\-factor=BLOCKS
dac2710
BLOCKS x 512 bytes per record
dac2710
.TP
e6f5bb4
\-B, \-\-read\-full\-records
dac2710
reblock as we read (for 4.2BSD pipes)
dac2710
.TP
e6f5bb4
\-i, \-\-ignore\-zeros
dac2710
ignore zeroed blocks in archive (means EOF)
dac2710
.TP
e6f5bb4
\-\-record\-size=NUMBER
dac2710
NUMBER of bytes per record, multiple of 512
dac2710
.IP
dac2710
Archive format selection:
dac2710
.TP
e6f5bb4
\-H, \-\-format=FORMAT
dac2710
create archive of the given format
dac2710
.IP
dac2710
FORMAT is one of the following:
dac2710
.TP
dac2710
gnu
dac2710
GNU tar 1.13.x format
dac2710
.TP
dac2710
oldgnu
dac2710
GNU format as per tar <= 1.12
dac2710
.TP
dac2710
pax
dac2710
POSIX 1003.1\-2001 (pax) format
dac2710
.TP
dac2710
posix
dac2710
same as pax
dac2710
.TP
dac2710
ustar
dac2710
POSIX 1003.1\-1988 (ustar) format
dac2710
.TP
dac2710
v7
dac2710
old V7 tar format
dac2710
.TP
e6f5bb4
\-\-old\-archive, \-\-portability
e6f5bb4
same as \-\-format=v7
dac2710
.TP
e6f5bb4
\-\-pax\-option=keyword[[:]=value][,keyword[[:]=value]]...
dac2710
control pax keywords
dac2710
.TP
e6f5bb4
\-\-posix
e6f5bb4
same as \-\-format=posix
dac2710
.TP
e6f5bb4
\-V, \-\-label=TEXT
dac2710
create archive with volume name TEXT; at
dac2710
list/extract time, use TEXT as a globbing pattern
dac2710
for volume name
dac2710
.IP
dac2710
Compression options:
dac2710
.TP
e6f5bb4
\-a, \-\-auto\-compress
dac2710
use archive suffix to determine the compression
dac2710
program
dac2710
.TP
e6f5bb4
\-I, \-\-use\-compress\-program=PROG
e6f5bb4
filter through PROG (must accept \-d)
dac2710
.TP
e6f5bb4
\-j, \-\-bzip2
dac2710
filter the archive through bzip2
dac2710
.TP
e6f5bb4
\-J, \-\-xz
dac2710
filter the archive through xz
dac2710
.TP
e6f5bb4
\-\-lzip
dac2710
filter the archive through lzip
dac2710
.TP
e6f5bb4
\-\-lzma
e6f5bb4
filter the archive through xz \-\-format=lzma
dac2710
.HP
e6f5bb4
\-\-lzop
dac2710
.TP
e6f5bb4
\-\-no\-auto\-compress
dac2710
do not use archive suffix to determine the
dac2710
compression program
dac2710
.TP
e6f5bb4
\-z, \-\-gzip, \-\-gunzip, \-\-ungzip
dac2710
filter the archive through gzip
dac2710
.TP
e6f5bb4
\-Z, \-\-compress, \-\-uncompress
dac2710
filter the archive through compress
dac2710
.IP
dac2710
Local file selection:
dac2710
.TP
e6f5bb4
\-\-add\-file=FILE
dac2710
add given FILE to the archive (useful if its name
dac2710
starts with a dash)
dac2710
.TP
e6f5bb4
\-\-backup[=CONTROL]
dac2710
backup before removal, choose version CONTROL
dac2710
.TP
e6f5bb4
\-C, \-\-directory=DIR
dac2710
change to directory DIR
dac2710
.TP
e6f5bb4
\-\-exclude=PATTERN
dac2710
exclude files, given as a PATTERN
dac2710
.TP
e6f5bb4
\-\-exclude\-backups
dac2710
exclude backup and lock files
dac2710
.TP
e6f5bb4
\-\-exclude\-caches
dac2710
exclude contents of directories containing
dac2710
CACHEDIR.TAG, except for the tag file itself
dac2710
.TP
e6f5bb4
\-\-exclude\-caches\-all
dac2710
exclude directories containing CACHEDIR.TAG
dac2710
.TP
e6f5bb4
\-\-exclude\-caches\-under exclude everything under directories containing
dac2710
CACHEDIR.TAG
dac2710
.TP
e6f5bb4
\-\-exclude\-tag=FILE
dac2710
exclude contents of directories containing FILE,
dac2710
except for FILE itself
dac2710
.HP
e6f5bb4
\-\-exclude\-tag\-all=FILE exclude directories containing FILE
dac2710
.TP
e6f5bb4
\-\-exclude\-tag\-under=FILE
dac2710
exclude everything under directories
dac2710
containing FILE
dac2710
.TP
e6f5bb4
\-\-exclude\-vcs
dac2710
exclude version control system directories
dac2710
.TP
e6f5bb4
\-h, \-\-dereference
dac2710
follow symlinks; archive and dump the files they
dac2710
point to
dac2710
.TP
e6f5bb4
\-\-hard\-dereference
dac2710
follow hard links; archive and dump the files they
dac2710
refer to
dac2710
.TP
e6f5bb4
\-K, \-\-starting\-file=MEMBER\-NAME
e6f5bb4
begin at member MEMBER\-NAME when reading the
e6f5bb4
archive
dac2710
.TP
e6f5bb4
\-\-newer\-mtime=DATE
dac2710
compare date and time when data changed only
dac2710
.TP
e6f5bb4
\-\-no\-null
e6f5bb4
disable the effect of the previous \-\-null option
dac2710
.TP
e6f5bb4
\-\-no\-recursion
dac2710
avoid descending automatically in directories
dac2710
.TP
e6f5bb4
\-\-no\-unquote
e6f5bb4
do not unquote filenames read with \-T
dac2710
.HP
e6f5bb4
\-\-null                 \-T reads null\-terminated names, disable \-C
dac2710
.TP
e6f5bb4
\-N, \-\-newer=DATE\-OR\-FILE, \-\-after\-date=DATE\-OR\-FILE
dac2710
only store files newer than DATE\-OR\-FILE
dac2710
.TP
e6f5bb4
\-\-one\-file\-system
dac2710
stay in local file system when creating archive
dac2710
.TP
e6f5bb4
\-P, \-\-absolute\-names
e6f5bb4
don't strip leading '/'s from file names
dac2710
.TP
e6f5bb4
\-\-recursion
dac2710
recurse into directories (default)
dac2710
.TP
e6f5bb4
\-\-suffix=STRING
dac2710
backup before removal, override usual suffix ('~'
dac2710
unless overridden by environment variable
dac2710
SIMPLE_BACKUP_SUFFIX)
dac2710
.TP
e6f5bb4
\-T, \-\-files\-from=FILE
dac2710
get names to extract or create from FILE
dac2710
.TP
e6f5bb4
\-\-unquote
e6f5bb4
unquote filenames read with \-T (default)
dac2710
.TP
e6f5bb4
\-X, \-\-exclude\-from=FILE
dac2710
exclude patterns listed in FILE
dac2710
.IP
dac2710
File name transformations:
dac2710
.TP
e6f5bb4
\-\-strip\-components=NUMBER
dac2710
strip NUMBER leading components from file
dac2710
names on extraction
dac2710
.TP
e6f5bb4
\-\-transform=EXPRESSION, \-\-xform=EXPRESSION
dac2710
use sed replace EXPRESSION to transform file
dac2710
names
dac2710
.IP
dac2710
File name matching options (affect both exclude and include patterns):
dac2710
.TP
e6f5bb4
\-\-anchored
dac2710
patterns match file name start
dac2710
.TP
e6f5bb4
\-\-ignore\-case
dac2710
ignore case
dac2710
.TP
e6f5bb4
\-\-no\-anchored
e6f5bb4
patterns match after any '/' (default for
dac2710
exclusion)
dac2710
.TP
e6f5bb4
\-\-no\-ignore\-case
dac2710
case sensitive matching (default)
dac2710
.TP
e6f5bb4
\-\-no\-wildcards
dac2710
verbatim string matching
dac2710
.TP
e6f5bb4
\-\-no\-wildcards\-match\-slash
e6f5bb4
wildcards do not match '/'
dac2710
.TP
e6f5bb4
\-\-wildcards
dac2710
use wildcards (default)
dac2710
.TP
e6f5bb4
\-\-wildcards\-match\-slash
e6f5bb4
wildcards match '/' (default for exclusion)
dac2710
.IP
dac2710
Informative output:
dac2710
.TP
e6f5bb4
\-\-checkpoint[=NUMBER]
dac2710
display progress messages every NUMBERth record
dac2710
(default 10)
dac2710
.TP
e6f5bb4
\-\-checkpoint\-action=ACTION
dac2710
execute ACTION on each checkpoint
dac2710
.TP
e6f5bb4
\-\-full\-time
dac2710
print file time to its full resolution
dac2710
.TP
e6f5bb4
\-\-index\-file=FILE
dac2710
send verbose output to FILE
dac2710
.TP
e6f5bb4
\-l, \-\-check\-links
dac2710
print a message if not all links are dumped
dac2710
.TP
e6f5bb4
\-\-no\-quote\-chars=STRING
dac2710
disable quoting for characters from STRING
dac2710
.TP
e6f5bb4
\-\-quote\-chars=STRING
dac2710
additionally quote characters from STRING
dac2710
.TP
e6f5bb4
\-\-quoting\-style=STYLE
dac2710
set name quoting style; see below for valid STYLE
dac2710
values
dac2710
.TP
e6f5bb4
\-R, \-\-block\-number
dac2710
show block number within archive with each message
dac2710
.TP
e6f5bb4
\-\-show\-defaults
dac2710
show tar defaults
dac2710
.TP
e6f5bb4
\-\-show\-omitted\-dirs
dac2710
when listing or extracting, list each directory
dac2710
that does not match search criteria
dac2710
.TP
e6f5bb4
\-\-show\-snapshot\-field\-ranges
e6f5bb4
show valid ranges for snapshot\-file fields
e6f5bb4
.TP
e6f5bb4
\-\-show\-transformed\-names, \-\-show\-stored\-names
dac2710
show file or archive names after transformation
dac2710
.TP
e6f5bb4
\-\-totals[=SIGNAL]
dac2710
print total bytes after processing the archive;
dac2710
with an argument \- print total bytes when this
dac2710
SIGNAL is delivered; Allowed signals are: SIGHUP,
dac2710
SIGQUIT, SIGINT, SIGUSR1 and SIGUSR2; the names
dac2710
without SIG prefix are also accepted
dac2710
.TP
e6f5bb4
\-\-utc
dac2710
print file modification times in UTC
dac2710
.TP
e6f5bb4
\-v, \-\-verbose
dac2710
verbosely list files processed
dac2710
.TP
e6f5bb4
\-\-warning=KEYWORD
dac2710
warning control
dac2710
.TP
e6f5bb4
\-w, \-\-interactive, \-\-confirmation
dac2710
ask for confirmation for every action
dac2710
.IP
dac2710
Compatibility options:
dac2710
.TP
e6f5bb4
\-o
e6f5bb4
when creating, same as \-\-old\-archive; when
e6f5bb4
extracting, same as \-\-no\-same\-owner
dac2710
.IP
dac2710
Other options:
dac2710
.TP
e6f5bb4
\-?, \-\-help
dac2710
give this help list
dac2710
.TP
e6f5bb4
\-\-restrict
dac2710
disable use of some potentially harmful options
dac2710
.TP
e6f5bb4
\-\-usage
dac2710
give a short usage message
dac2710
.TP
e6f5bb4
\-\-version
dac2710
print program version
dac2710
.PP
dac2710
Mandatory or optional arguments to long options are also mandatory or optional
dac2710
for any corresponding short options.
dac2710
.PP
e6f5bb4
The backup suffix is '~', unless set with \-\-suffix or SIMPLE_BACKUP_SUFFIX.
e6f5bb4
The version control may be set with \-\-backup or VERSION_CONTROL, values are:
dac2710
.TP
dac2710
none, off
dac2710
never make backups
dac2710
.TP
dac2710
t, numbered
dac2710
make numbered backups
dac2710
.TP
dac2710
nil, existing
dac2710
numbered if numbered backups exist, simple otherwise
dac2710
.TP
dac2710
never, simple
dac2710
always make simple backups
dac2710
.PP
e6f5bb4
Valid arguments for the \-\-quoting\-style option are:
dac2710
.IP
dac2710
literal
dac2710
shell
dac2710
shell\-always
dac2710
c
dac2710
c\-maybe
dac2710
escape
dac2710
locale
dac2710
clocale
dac2710
.PP
dac2710
*This* tar defaults to:
e6f5bb4
\-\-format=gnu \-f\- \-b20 \-\-quoting\-style=escape \-\-rmt\-command=/etc/rmt
e6f5bb4
\-\-rsh\-command=/usr/bin/ssh
dac2710
.SH AUTHOR
dac2710
Written by John Gilmore and Jay Fenlason.
dac2710
.SH "REPORTING BUGS"
dac2710
Report bugs to <bug\-tar@gnu.org>.
dac2710
.SH COPYRIGHT
e6f5bb4
Copyright \(co 2013 Free Software Foundation, Inc.
dac2710
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
dac2710
.br
dac2710
This is free software: you are free to change and redistribute it.
dac2710
There is NO WARRANTY, to the extent permitted by law.
dac2710
.SH "SEE ALSO"
dac2710
The full documentation for
dac2710
.B tar
dac2710
is maintained as a Texinfo manual.  If the
dac2710
.B info
dac2710
and
dac2710
.B tar
dac2710
programs are properly installed at your site, the command
dac2710
.IP
dac2710
.B info tar
dac2710
.PP
dac2710
should give you access to the complete manual.