Back to main site | Back to man page index

TAR(1)                                              User Commands                                              TAR(1)

       tar - manual page for tar 1.26

       tar [OPTION...] [FILE]...

       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  functional‐
       ity)  originally generated by the help2man utility.  The full documentation for tar is maintained as a Texinfo
       manual.  If the info and tar programs are properly installed at your site, the command `info tar' should  give
       you access to the complete manual.

       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.

       *This* tar installation defaults to:

       --format=gnu -f- -b20 --quoting-style=escape --rmt-command=/sbin/rmt --rsh-command=/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 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 the archive volume label and exit

       -u, --update
              only append files newer than copy in archive

       -x, --extract, --get

        -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 numbers when creating incremental archives (default)

       -g, --listed-incremental=FILE
              handle new GNU-format incremental backup

       -G, --incremental
              handle old GNU-format incremental backup

              do not exit with nonzero on unreadable files

              dump level for created listed-incremental archive

       -n, --seek
              archive is seekable

              do not check device numbers when creating incremental archives

              archive is not seekable

              process only the NUMBERth occurrence of each file in the archive; this option is valid only in conjunc‐
              tion with one of the subcommands --delete, --diff, --extract or --list and when  a  list  of  files  is
              given either on the command line or via the -T option; NUMBER defaults to 1

              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


              empty hierarchies prior to extracting directory

              remove files after adding them to the archive

              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

              treat non-zero exit codes of children as error

       -O, --to-stdout
              extract files to standard output

              pipe extracted files to another program

Handling of file attributes:
              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 setting modification times and permissions of extracted directories until the end of extraction

              force NAME as group for added files

              force (symbolic) mode CHANGES for added files

              set mtime for added files from DATE-OR-FILE

       -m, --touch
              don't extract file modified time

              cancel the effect of --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)

              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

              Disable the POSIX ACLs support

              Disable the SELinux context support

              Disable extended attributes support

              Enable the SELinux context support

              Enable extended attributes support

              specify the exclude pattern for xattr keys

              specify the include pattern for xattr keys

Device selection and switching:
       -f, --file=ARCHIVE
              use archive file or device ARCHIVE

              archive file is 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 1024 bytes

       -M, --multi-volume
              create/list/extract multi-volume archive

              use given rmt COMMAND instead of rmt

              use remote COMMAND instead of rsh

              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

              control pax keywords

              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

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


              add given FILE to the archive (useful if its name starts with a dash)

              backup before removal, choose version CONTROL

       -C, --directory=DIR
              change to directory DIR

              exclude files, given as a PATTERN

              exclude backup and lock files

              exclude contents of directories containing CACHEDIR.TAG, except for the tag file itself

              exclude directories containing CACHEDIR.TAG

       --exclude-caches-under exclude everything under directories containing

              exclude contents of directories containing FILE, except for FILE itself

       --exclude-tag-all=FILE exclude directories containing FILE

              exclude everything under directories containing FILE

              exclude version control system directories

       -h, --dereference
              follow symlinks; archive and dump the files they point to

              follow hard links; archive and dump the files they refer to

       -K, --starting-file=MEMBER-NAME
              begin at member MEMBER-NAME in the archive

              compare date and time when data changed only

              disable the effect of the previous --null option

              avoid descending automatically in directories


              recurse into directories (default)

              backup before removal, override usual suffix  ('~'  unless  overridden  by  environment  variable  SIM‐

       -T, --files-from=FILE
              get names to extract or create from FILE

              unquote filenames read with -T (default)

       -X, --exclude-from=FILE
              exclude patterns listed in FILE

File name transformations:
              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):

              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)

              wildcards match `/' (default for exclusion)

Informative output:
              display progress messages every NUMBERth record (default 10)

              disable quoting for characters from STRING

              additionally quote characters from STRING

              set name quoting style; see below for valid STYLE values

       -R, --block-number
              show block number within archive with each message

              show tar defaults

              when listing or extracting, list each directory that does not match search criteria

       --show-transformed-names, --show-stored-names
              show file or archive names after transformation

              print  total  bytes after processing the archive; with an argument - print total bytes when this SIGNAL
              is delivered; Allowed signals are: SIGHUP, SIGQUIT, SIGINT, SIGUSR1 and SIGUSR2; the names without  SIG
              prefix are also accepted

       --utc  print file modification dates in UTC

       -v, --verbose
              verbosely list files processed

              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

              disable use of some potentially harmful options

              give a short usage message

              print program version

       Mandatory  or  optional  arguments  to long options are also mandatory or optional for any corresponding short

              numbered if numbered backups exist, simple otherwise

       never, simple
              always make simple backups

       Valid arguments for the --quoting-style option are:

              literal shell shell-always c c-maybe escape locale clocale

       Written by John Gilmore and Jay Fenlason.

       Report bugs to <[email protected]>.

       Copyright   ©   2013   Free   Software   Foundation,  Inc.   License  GPLv3+:  GNU  GPL  version  3  or  later
       This is free software: you are free to change and redistribute it.  There is NO WARRANTY, to the  extent  per‐
       mitted by law.

tar 1.26                                            February 2013                                              TAR(1)