Tar (1) User Commands tar (1)
NAME
Tar-manual page for tar 1.26
Synopsis
Tar [OPTION ...] [FILE] ...
DESCRIPTION
GNU ' tar ' saves many files together into a single tape or disk archive, and can
Restore individual files from the archive.
Note that this manual page contains just very brief description (or more like a
List of possible functionality) originally generated by the Help2man utility.
The full documentation to TAR is maintained as a Texinfo manual. If the Info
and tar programs is properly installed at your site, the command ' info tar '
Should give you access to the complete manual.
EXAMPLES
TAR-CF Archive.tar Foo Bar
# Create Archive.tar from Files foo and bar.
TAR-TVF Archive.tar
# List All files in Archive.tar verbosely.
TAR-XF Archive.tar
# Extract all files from Archive.tar.
DEFAULTS
*this* tar installation defaults to:
--format=gnu-f--b20--quoting-style=escape--rmt-command=/sbin/rmt--rsh-com‐
Mand=/usr/bin/rsh
Main operation mode:
-A,--catenate,--concatenate
Append tar files to an archive
-C,--create
Create a new archive
-D,--diff,--compare
Find differences between archive and file system
--delete
Delete from the archive (not on Mag tapes!)
-R,--append
Append files to the end of an archive
-T,--list
List the contents of an archive
--test-label
Test the archive volume label and exit
-U,--update
Only append files newer than copy in archive
-X,--extract,--get
Extract files from an archive
Common options:
-C,--directory=dir
Change to Directory DIR
-F,--file=archive
Use archive file or device archive
-j,--BZIP2
Filter the archive through BZIP2
-j,--XZ
Filter the archive through XZ
-P,--preserve-permissions
Extract information about file permissions (default for Superuser)
-V,--verbose
verbosely List Files processed
-Z,--gzip
Filter the archive through gzip
Operation Modifiers:
--check-device
Check device numbers when creating incremental archives (default)
-G,--listed-incremental=file
Handle New Gnu-format Incremental backup
-G,--incremental
Handle Old Gnu-format Incremental backup
--ignore-failed-read
Don't exit with nonzero on unreadable files
--level=number
Dump level for created Listed-incremental archive
-N,--seek
Archive is seekable
--no-check-device
Don't check device numbers when creating incremental archives
--no-seek
Archive is not seekable
--occurrence[=number]
Process only the Numberth occurrence of each file in the archive; This
option is valid-conjunction with one of the subcommands--delete,
--diff,--extract or--list and when a list of files are given either on
The command line or via THE-T option; Number defaults to 1
--sparse-version=major[. MINOR]
Set version of the sparse format to use (implies--sparse)
-S,--sparse
Handle Sparse files Efficiently
Overwrite Control:
-K,--keep-old-files
Don ' t replace existing files when extracting, treat them as errors
--keep-newer-files
Don ' t replace existing files that is newer than their archive copies
--no-overwrite-dir
Preserve metadata of existing directories
--overwrite
Overwrite existing files when extracting
--overwrite-dir
Overwrite metadata of existing directories when extracting (default)
--recursive-unlink
Empty hierarchies prior to extracting directory
--remove-files
Remove files after adding them to the archive
--skip-old-files
Don ' t replace existing files when extracting, silently skip over them
-U,--unlink-first
Remove each file prior to extracting over it
-W,--verify
Attempt to verify the archive after writing it
Select output stream:
--ignore-command-error Ignore exit codes of children
--no-ignore-command-error
Treat Non-zero exit codes of children as error
-O,--to-stdout
Extract files to standard output
--to-command=command
Pipe extracted files to another program
Handling of file attributes:
--atime-preserve[=method]
Preserve access times on dumped files, either by restoring the Times
After reading (method= ' replace '; default) or by not setting the times in
The first place (method= ' system ')
--delay-directory-restore
Delay setting modification times and permissions of extracted directories
Until the end of extraction
--group=name
Force NAME as group for added files
--mode=changes
Force (symbolic) mode changes for added files
--mtime=date-or-file
Set mtime for added files from date-or-file
-M,--touch
Don ' t extract file modified time
--no-delay-directory-restore
Cancel the effect of--delay-directory-restore option
--no-same-owner
Extract files as yourself (default for ordinary users)
--no-same-permissions
Apply the user ' s umask when extracting permissions from the archive
(Default for ordinary users)
--numeric-owner
Always use numbers for User/group names
--owner=name
Force NAME as owner for added files
-P,--preserve-permissions,--same-permissions
Extract information about file permissions (default for Superuser)
--preserve
Same as Both-p And-s
--same-owner
Try extracting files with the same ownership as exists in the archive
(Default for Superuser)
-S,--preserve-order,--same-order
Sort names to extract to match archive
Handling of Extended file attributes:
--acls Enable the POSIX ACLs support
--no-acls
Disable the POSIX ACLs support
--no-selinux
Disable The SELinux context support
--no-xattrs
Disable Extended Attributes Support
--selinux
Enable The SELinux context support
--xattrs
Enable Extended Attributes Support
--xattrs-exclude=mask
Specify the exclude pattern for xattr keys
--xattrs-include=mask
Specify the include pattern for xattr keys
Device Selection and switching:
-F,--file=archive
Use archive file or device archive
--force-local
Archive file is the local even if it has a colon
-F,--info-script=name,--new-volume-script=name
Run script at end of each tape (IMPLIES-M)
-L,--tape-length=number
Change tape after writing number x 1024x768 bytes
-M,--multi-volume
Create/list/extract multi-volume Archive
--rmt-command=command
Use given RMT COMMAND instead of RMT
--rsh-command=command
Use remote COMMAND instead of RSH
--volno-file=file
Use/update the volume number in FILE
Device Blocking:
-B,--blocking-factor=blocks
BLOCKS x bytes per record
-B,--read-full-records
Reblock as we read (for 4.2BSD pipes)
-I.,--ignore-zeros
Ignore zeroed blocks in archive (means EOF)
--record-size=number
Number of bytes per record, multiple of 512
Archive Format Selection:
-H,--format=format
Create archive of the given format
FORMAT is one of the following:
GNU GNU Tar 1.13.x format
OLDGNU GNU format as per tar <= 1.12
Pax POSIX 1003.1-2001 (PAX) format
POSIX same as Pax
Ustar POSIX 1003.1-1988 (ustar) format
V7 Old V7 tar format
--old-archive,--portability
Same as--format=v7
--pax-option=keyword[[:]=value][,keyword[[:]=value]] ...
Control pax Keywords
--posix
Same as--format=posix
-V,--label=text
Create archive with volume name TEXT; At list/extract time, use TEXT as a
globbing Pattern for volume name
Compression options:
-A,--auto-compress
Use archive suffix to determine the compression program
-I.,--use-compress-program=prog
Filter through PROG (must accept-d)
-j,--BZIP2
Filter the archive through BZIP2
-j,--XZ
Filter the archive through XZ
--lzip Filter the archive through Lzip
--lzma Filter the archive through LZMA
--lzop
--no-auto-compress
Archive suffix to determine the compression program
-Z,--gzip,--gunzip,--ungzip
Filter the archive through gzip
-Z,--compress,--uncompress
Filter the archive through compress
Note:you might need to the install external program (Lzip/ncompress/lzma ...) to use
Some of these compression options
Local File Selection:
--add-file=file
Add given FILE to the archive (useful if it name starts with a dash)
--backup[=control]
Backup before removal, choose version CONTROL
-C,--directory=dir
Change to Directory DIR
--exclude=pattern
Exclude files, given as a PATTERN
--exclude-backups
Exclude Backup and Lock files
--exclude-caches
Exclude contents of directories containing Cachedir. TAG, except for the
Tag file itself
--exclude-caches-all
Exclude directories containing Cachedir. TAG
--exclude-caches-under exclude everything under directories containing
Cachedir. TAG
--exclude-tag=file
Exclude contents of directories containing file, except for FILE itself
--exclude-tag-all=file Exclude directories containing FILE
--exclude-tag-under=file
Exclude everything under directories containing FILE
--exclude-vcs
Exclude version control system directories
-H,--dereference
Follow symlinks; Archive and dump the files they point to
--hard-dereference
Follow hard links; Archive and dump the files they refer to
-K,--starting-file=member-name
Begin at Member Member-name in the archive
--newer-mtime=date
Compare date and time when data changed only
--no-null
Disable the effect of the previous--null option
--no-recursion
Avoid descending automatically in directories
--no-unquote
Do not unquote filenames read with-t
--null-t reads null-terminated names, disable-c
-N,--newer=date-or-file,--after-date=date-or-file
Only store files newer than Date-or-file
--one-file-system
Stay in the local file system when creating archive
-P,--absolute-names
Don ' t strip leading '/' s from file names
--recursion
Recurse into directories (default)
--suffix=string
Backup before removal, override usual suffix (' ~ ' unless overridden by
environment variable Simple_backup_suffix)
-T,--files-from=file
Get names to extract or create from FILE
--unquote
unquote filenames read WITH-T (default)
-X,--exclude-from=file
Exclude patterns listed in FILE
File Name Transformations:
--strip-components=number
Strip number leading components from file names on extraction
--transform=expression,--xform=expression
Use sed replace EXPRESSION to transform file names
File Name matching options (affect both exclude and include patterns):
--anchored
Patterns Match file name start
--ignore-case
Ignore case
--no-anchored
Patterns match after any '/' (Default for exclusion)
--no-ignore-case
Case sensitive matching (default)
--no-wildcards
Verbatim string Matching
--no-wildcards-match-slash
Wildcards does not match '/'
--wildcards
Use wildcards (default)
--wildcards-match-slash
Wildcards match '/' (Default for exclusion)
Informative output:
--checkpoint[=number]
Display progress messages every Numberth record (default 10)
--checkpoint-action=action
Execute ACTION on each checkpoint
--full-time
Print file time to it full resolution
--index-file=file
Send verbose output to FILE
-L,--check-links
Print a message if not all links is dumped
--no-quote-chars=string
Disable quoting for characters from STRING
--quote-chars=string
Additionally quote characters from STRING
--quoting-style=style
Set name quoting style; See below for valid STYLE values
-R,--block-number
Show block number within archive with each message
--show-defaults
Show tar defaults
--show-omitted-dirs
When listing or extracting, list all directory that does not match
Search criteria
--show-transformed-names,--show-stored-names
Show file or archive names after transformation
--totals[=signal]
Print Total bytes after processing the archive; With an Argument-print
Total Bytes-SIGNAL is delivered; Allowed Signals Are:sighup,
Sigquit, SIGINT, SIGUSR1 and SIGUSR2; The names without SIG prefix is
Also accepted
--UTC Print file modification dates in UTC
-V,--verbose
verbosely List Files processed
--warning=keyword
Warning control
-W,--interactive,--confirmation
Ask for confirmation for every action
Compatibility options:
-O when creating, same as--old-archive; When extracting, same as
--no-same-owner
Other options:
-?,--Help
Give this Help list
--restrict
Disable use of some potentially harmful options
--usage
Give a short usage message
--version
Print Program version
Mandatory or optional arguments to long options is also Mandatory or optional
For any corresponding short options.
The backup suffix is ' ~ ', and unless set with--suffix or Simple_backup_suffix. The
Version control May is set with--backup or Version_control, values is:
None, off
Never make backups
T, numbered
Make numbered backups
Nil, existing
Numbered if numbered backups exist, simple otherwise
Never, simple
Always do simple backups
Valid arguments for the--quoting-style option is:
Literal shell shell-always C c-maybe escape locale Clocale
AUTHOR
Written by John Gilmore and Jay Fenlason.
REPORTING BUGS
Report bugs to <[email Protected]>.
COPYRIGHT
copyright©2013 Free Software Foundation, Inc. License gplv3+: GNU GPL version
3 or later This was free software:you was free to change and redistribute it. There is NO
WARRANTY, to the extent permitted.
tar 1.26 February tar (1)
Tar Command man description