tar(1)tar(1)Nametar - multivolume archiver
Syntaxtar [key] [name...]
Description
The tape archiver command, saves and restores multiple files to and
from a single archive. The default archive device is but any file or
device may be requested through the use of options.
The key is a string of characters containing at most one function let‐
ter and possibly 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.
This utility supports EOT handling which allows the use of multiple
media. The utility prompts for the next volume when it encounters the
end of the current volume.
This utility supports the TA90 style sequential stacker loader device.
The device ejects a cartridge when it is taken off line. This utility
performs the device ejection on behalf of the user when it encounters a
multivolume boundary during write or read operations involving tape.
The device then automatically loads the next available tape (if there
is one). The utility then attempts to access this next tape for a rea‐
sonable amount of time (approximately three minutes) before prompting
the user for a manual reload operation.
Function Keys
The function portion of the key is specified by one of the following
letters:
c Create a new archive on tape, disk or file. Writing starts at
the beginning of the archive instead of after the last file.
r Write the named files to the end of the archive.
t List the names of the files as they occur on the input archive.
u Add the named files to the archive if they are not there
already or if they have been modified since they were last put
in the archive.
x Extract the named files from the archive. If the named file
matches a directory whose contents had been written into the
archive, the 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 archive is
extracted. Note that if multiple entries specifying the same
file are in the archive, the last one overwrites all previous
versions extracted.
Options
You can use one or more of the following options in addition to the
letter which selects the function desired:
0...9 Substitute number for the device unit number as in The
default is the high density rewind tape device number zero
named The following tar command uses device
% tar cv4 tar.c
A Use next argument as archive number with which to begin out‐
put.
B Force input and output blocking to 20 blocks/record. This
option allows to work across a communications channel where
the blocking may not be maintained.
D Directory output in original style.
C Use to perform a directory change prior to archiving data.
F[ F ] Operate in fast mode . When F is specified, skips all SCCS
directories, core files, and error files. When FF is speci‐
fied, also skips all and *.o files.
H Help mode. Print a summary of the function keys and options.
L Permits the program to treat the tape drive as a sequential
loader device even though it is not represented as such in
the system driver tables.
M Next argument specifies maximum archive number to be written
and prints current archive number on output line.
N No multi-archive, file splitting, or new header format on
output. Output directories in previous tar format. On input,
set file UID and GID from file header vs. values in and group
files.
O Include file owner and group names in verbose output (t and x
functions) if present in archive header. Output warning mes‐
sage if owner or group name not found in or file (cru func‐
tions).
P Used to specify POSIX format tapes. Necesary only with the c
key.
R Each named file contains a list of file names separated by
newlines which is added to (c function key) or extracted from
(x function key) the archive.
S Output User Group Standard archive format.
V Display extended verbose information. Included are the ver‐
sion number of the number of blocks used on the device, the
number of blocks in a file, and the protection modes given in
a format similar to the ls -l command. In addition to this
information, V provides the information given by the v
option.
b Use the next argument as the blocking factor for tape
records. The default is 20 (the maximum is 127). This
option should only be used with raw magnetic tape archives
(see the f option). This option is unnecessary when reading
tapes (x and t keys). See the Restrictions section.
d Use as the default device. The command is recommended for
use with floppy disks.
f Use the next argument as the name of the archive instead of
If the name of the file is - , writes to standard output or
reads from standard input, whichever is appropriate. Thus,
can be used as the head or tail of a filter chain. You can
also use to move hierarchies. The following example shows
how to move the directory to the directory
# cd fromdir; tar cf - . | (cd todir; tar xpf -)
h Save a copy of the actual file on the output device under the
symbolic link name, instead of placing the symbolic informa‐
tion on the output. The default action of is to place sym‐
bolic link information on the output device. A copy of the
file itself is not saved on the output device.
i Ignore checksum errors found in the archive.
l Complain if cannot resolve all of the links to the files
dumped. If this is not specified, no error messages are
printed.
m Do not restore the modification times. The modification time
is the time of extraction. Tar normally restores modifica‐
tion times of regular and special files.
o Suppress the normal directory information. On output, nor‐
mally places information specifying owner and modes of direc‐
tories in the archive. Former versions of when encountering
this information will give error message of the following
form:
<name>/: cannot create
The command will place information specifying owner and modes
of directories in the archive.
p Restore the named files to their original modes, ignoring the
present Setuid and sticky bit information is also restored to
the superuser.
s Next argument specifies size of archive in 512 byte blocks.
v Write the name of each file treated, preceded by the function
letter, to diagnostic output. Normally, does its work
silently. With the t function key, the verbose option pro‐
vides more information about the tape entries than just their
names.
#cd /
#tar cvf tar-out vmunix
The preceeding command produces the output ``a vmunix 1490
blocks'' where 1490 is the number of 512 byte blocks in the
file ``vmunix''.
#tar xvf tar-out
The proceeding command produces the output ``x vmunix, 762880
bytes, 1490 blocks'' where 762880 is the number of bytes and
1490 is the number of 512 byte blocks in the file ``vmunix''
which was extracted.
w Print the action to be taken, followed by file name, then
wait for user confirmation. If a word beginning with the
letter y is given, the action is done. Any other input means
do not do it.
Restrictions
The option fails to ignore umask when extracting a file that has been
archived by the DEC/OSF 1 command. Use to work around the limitation.
There is no way to ask for the nth occurrence of a file.
Tape errors are handled ungracefully.
The u key can be slow.
The limit on file name length is 100 characters.
There is no way to follow symbolic links selectively.
On SCSI tape devices tar (when reading) may end on one volume of a mul‐
tivolume set without prompting for the next volume. This is a very
infrequent condition. The next volume should be loaded and the command
issued again.
Using a blocking factor other than the default (b option) may lead to
higher performance. However, you must select a value that is compati‐
ble with the hardware limitations of the source and destination
machines. Software limitations may apply for other versions of
When extracting (x), reads the entire tape. See the r and u keys.
The u and the r function keys do not operate with quarter-inch tape
cartidge drives such as the TZK10.
ULTRIX due to BSD coding, does not completely fill a flexible disc in
multivolume situations.
In multivolulme situations, ULTRIX employs the following header rules
for volume-spanning files. At the beginning of the next volume, a sec‐
ond header is written that includes both the full size of the file and
the size of the file segment that is written on the second volume. The
first header states the full size of the file only. These rules may
not be compatible with other systems' versions of
Examples
To archive files from and type:
# tar c -C /usr/include . -C /etc .
The command can properly handle blocked archives.
Diagnostics
The command produces diagnostics when it encounters bad key characters,
read/write errors and when there is not enough memory available to hold
the link tables.
FilesSee Alsomdtar(1), mt(1), tar(5)tar(1)