tar(1) DG/UX 4.30 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). Tar
images can be transferred between machines that use this
POSIX-compliant tar command. Tar's actions are controlled
by the key argument. The key 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.
The function portion of the key is specified by one of the
following letters:
r The named files are written on the end of the tape.
The c function implies this.
x The named files are extracted from the tape. If the
named file matches a directory whose contents had
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.
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.
u The named files are added to the tape if either they
are not already there or have been modified since
last put on the tape.
c Create a new tape; writing begins on the beginning
of the tape instead of after the last file. This
command implies r.
The following characters may be used in addition to the
letter which selects the function desired.
o On output, tar normally places information
specifying owner and modes of directories in the
archive. Former versions of tar, when
Licensed material--property of copyright holder(s) Page 1
tar(1) DG/UX 4.30 tar(1)
encountering this information will give an error
message of the form:
<name>/: cannot create
This modifier will suppress the directory
information.
On input, the o modifier causes extracted files to
take on the user and group identifier of the user
running the program rather than those on the tape.
p This modifier says to restore files to their
original modes, ignoring the present umask(2).
Setuid and sticky bit information will also be
restored to the super-user.
0, ..., 9 This modifier selects an alternate drive on which
the tape is mounted. The default is drive 0,
which is normally /dev/rmt/0.
v Normally tar does its work silently. The v
(verbose) 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 Tar prints the action to be taken followed by the
file name, then waits for user confirmation. If
you answer with a word beginning with y, tar
completes the action. If your answer does not
start with y, tar does not carry out the action.
f Tar uses the next argument as the name of the
archive instead of /dev/rmt/?. If the name of the
file is -, tar writes to standard output or reads
from standard input, whichever is appropriate.
Thus, tar can be used as the head or tail of a
filter chain. Tar can also be used to move
hierarchies with the command
cd fromdir; tar cf - . | (cd todir; tar xf -)
b Tar uses the next argument as the blocking factor
for tape records. The default is 32 (the maximum).
This option should be used only with raw magnetic
tape archives (not with disk files, as in f
above). The block size is determined
automatically when reading tapes (key letters x
and t).
Licensed material--property of copyright holder(s) Page 2
tar(1) DG/UX 4.30 tar(1)
l tells tar to complain if it cannot resolve all of
the links to the files dumped. If this is not
specified, no error messages are printed.
m tells tar not to restore the modification times.
The modification time will be the time of
extraction.
h Forces tar to follow symbolic links as if they
were normal files or directories. Normally, tar
does not follow symbolic links.
B Forces input and output blocking to 32 blocks per
record. This option was added so that tar can
work across a communications channel where the
blocking may not be maintained.
C If a directory name is preceded by -C, tar
performs a chdir(2) to that directory name. This
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, one might use
tar c -C /usr include -C /etc
O Tells tar to behave like the 4.3BSD tar.
Normally, POSIX-compatible headers are read and
written. The -O option tells tar to produce
4.3BSD headers on output and to ignore the POSIX
header extensions on input. This option should
only be used to produce tapes to be read by older
versions of tar.
Tar supports control point directories.
EXAMPLES
$ tar xv file1 file2
a file1 48 blocks
a file2 64 blocks
This command causes file1 and file2 to be read from the
default tape device (/dev/rmt/0). The files are listed as
they are read from tape.
$ tar cvf /dev/rmt/0 input1 input2
a input1 63 blocks
a input2 47 blocks
This command causes input1 and input2 to be written to the
Licensed material--property of copyright holder(s) Page 3
tar(1) DG/UX 4.30 tar(1)
tape on device /dev/rmt/0. The files are listed as they are
written to the archive file. If /dev/rmt/0 were a filename
instead of a tape device, the archive output would go to
that file.
tar tvf output
rwxr-xr-x3000/1 31908 NOV 12 09:32 1987 input1
rwxr-xrwx3000/1 24064 NOV 11 14:26 1987 input2
This command causes all of the files on the archive file
(output) to be listed.
FILES
/dev/rmt/?
/tmp/tar*
SEE ALSO
tar(5)
POSIX 1003.1
DIAGNOSTICS
Complains about bad key characters and tape read/write
errors.
Complains if enough memory is not available to hold the link
tables.
NOTES
The r or u options are not supported by certain types of
tape drives, including models 6577 (QIC-150 150MB 1/4"
cartridge) and 6590 (8mm 2GB helical scan).
BUGS
There is no way to ask for the n-th occurrence of a file.
Tape errors are handled ungracefully.
The u option can be slow.
The current limit on file name length is 100 characters.
There is no way selectively to follow symbolic links.
When extracting tapes created with the r or u options,
directory modification times may not be set correctly.
Licensed material--property of copyright holder(s) Page 4