TAR(1) BSD TAR(1)
NAME
tar - tape archiver
SYNOPSIS
tar [ key ] [ name ... ]
DESCRIPTION
tar saves and restores multiple files on a single file (usually a
magnetic tape, but it can be any file). The key argument is a string of
characters containing at most one function letter and possibly one or
more function modifiers. Other arguments to tar are file or directory
names specifying which files to dump or restore. In all cases,
appearance of a directory name refers to the files and (recursively)
subdirectories of that directory.
FUNCTIONS
c Create a new tape; writing begins on the beginning of the tape
instead of after the last file. This command implies r.
r Write the named files on the end of the tape. The c function
implies this.
u Add the named files to the tape if they are not already there or
have been modified since last put on the tape.
x Extract the named files are extracted from the tape. If the
named file matches a directory whose contents have been written
onto the tape, this directory is (recursively) extracted. The
owner, modification time, and mode are restored (if possible).
If no file argument is given, the entire content of the tape is
extracted. Note that if multiple entries specifying the same
file are on the tape, the last one overwrites all earlier copies.
tar writes restored files to the current directory.
t The names of the specified files are listed each time they occur
on the tape. If no file argument is given, all of the names on
the tape are listed.
OPTIONS
Unlike function specifiers, option flags must be immediately preceded by
a dash (-).
0, ..., 9 Select an alternate drive on which the tape is mounted. The
default is drive 0 at 1600 bpi, which is normally /dev/rmt8.
B Force input and output blocking to 20 blocks per record. This
option allows tar to work across a communications channel where
the blocking may not be maintained.
b factor Use factor as the blocking factor for tape records. The default
is 20 (the maximum). This option should be used only with raw
magnetic tape archives. tar automatically determines block size
when reading tapes (with functions x and t).
C dir perform a chdir(2) to the filename preceded by this option.
This option allows multiple directories not related by a close
common parent to be archived using short relative path names.
For example, to archive files from /usr/include and from /etc,
you might use
tar c -C /usr include -C
Previous restrictions dealing with tar's inability to properly
handle blocked archives have been lifted.
f archive Use archive as the name of the archive instead of /dev/rmt?.
If you give a dash (-) as the name of the file, tar writes to
standard output or reads from standard input as appropriate.
You can use tar to move hierarchies with the command
cd fromdir; tar cf - . | (cd todir; tar xf -)
h Force tar to follow symbolic links as if they were normal files
or directories. Normally tar does not follow symbolic links.
l Complain if tar cannot resolve all of the links to the files
dumped.
m Do not restore the modification times. The modification time
is set to the time of extraction.
o Suppress writing of owner and permission information from
archived directories.
p Restore files to their original modes, ignoring the present
umask(2). Restores setuid to the super-user.
v Use verbose mode. Normally tar does its work silently. This
option makes tar print the name of each file it treats preceded
by the function letter. With the t function, the verbose
option gives more information about the tape entries than just
their names.
w Print the action to be taken followed by filename, then wait
for user confirmation. If you enter a word beginning with "y",
tar does the action. Any other input means "no".
A Include Apollo-specific information; this option allows tar to
handle Domain/OS typed files.
NOTES
Cartridge tapes must be rewound with the command mt rewind.
FILES
/dev/rmt?
/tmp/tar*
DIAGNOSTICS
Complains about bad key characters and tape read/write errors.
Complains if not enough memory is available to hold the link tables.
BUGS
There is no way to ask for the nth occurrence of a file.
Tape errors are handled ungracefully.
The u option can be slow.
The current limit on filename length is 100 characters.
There is no way to follow symbolic links selectively.
When you extract files created with the r or u options, directory
modification times may not be set correctly.
SEE ALSO
mt(1), rbak(1), wbak(1), rwmt(1), tar(5)