tar -- file archiver


tar is as specified in the SUS but with differences as listed below.


-A, --catenate, --concatenate

appends tar files to an archive.


is equivalent to -c.

-d, --diff, --compare

finds differences between archive and file system.


deletes from the archive. (Not for use on mag tapes!)


is equivalent to -r.


is equivalent to -t.


is equivalent to -u.

--extract, --get

extracts files from an archive.


does not change access times on dumped files.

--block-size N

is equivalent to -b.

-B, --read-full-blocks

reblocks as we read; for reading 4.2BSD pipes.

-C, --directory DIR

changes to directory DIR.


prints directory names while reading the archive.

-f, --file [HOSTNAME:]F

uses archive file or device F. The default is "-", meaning stdin/stdout.


specifies that archive file is local even if has a colon.

-F, --info-script F, --new-volume-script F

runs script at end of each tape; implies -M.

-G, --incremental

creates/lists/extracts old GNU-format incremental backup.

-g, --listed-incremental F

creates/lists/extracts new GNU-format incremental backup.

-h, --dereference

doesn't dump symlinks; dumps the files they point to.

-i, --ignore-zeros

ignores blocks of zeros in archive that normally mean EOF.


filters archive through bzip2; used to decompress .bz2 files.


doesn't exit with non-zero status on unreadable files.

-k, --keep-old-files

keeps existing files; doesn't overwrite them from archive.

-K, --starting-file F

begins at file F in the archive.

-l, --one-file-system

stays in local file system when creating an archive.

-L, --tape-length N

changes tapes after writing N*1024 bytes.


is equivalent to -m.

-M, --multi-volume

creates/lists/extracts multi-volume archive.

-N, --after-date DATE, --newer DATE

stores only files newer than DATE.

-o, --old-archive, --portability

writes a V7 format archive, rather than ANSI format. Note that for -o the behavior is different than what is specified in the SUSv2.

-O, --to-stdout

extracts files to standard output.

-p, --same-permissions, --preserve-permissions

extracts all protection information.

-P, --absolute-paths

does not strip leading /s from file names.


is equivalent to -p -s.

-R, --record-number

shows record number within archive with each message.


removes files after adding them to the archive.

-s, --same-order, --preserve-order

sorts list of names to extract to match archive.


creates extracted files with the same ownership.

-S, --sparse

handles sparse files efficiently.

-T, --files-from F

gets names to extract or create from file F.


causes -T to read null-terminated names; disables -C.


prints total bytes written with --create.


is equivalent to -v.

-V, --label NAME

creates archive with volume name NAME.


prints tar program version number.

-w, --interactive, --confirmation

asks for confirmation for every action.

-W, --verify

attempts to verify the archive after writing it.

--exclude FILE

excludes file FILE.

-X, --exclude-from FILE

excludes files listed in FILE.

-Z, --compress, --uncompress

filters the archive through compress.

-z, --gzip, --ungzip

filters the archive through gzip.

--use-compress-program PROG

filters the archive through PROG (which must accept -d)


blocks the output of compression program for tapes.


specifies drive and density.