'\"macro stdmacro
.if n .pH g1.tar @(#)tar	40.8 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} tar 1 "Essential Utilities" "\&"
.if \nX=1 .ds x} tar 1 "Essential Utilities"
.if \nX=2 .ds x} tar 1 "" "\&"
.if \nX=3 .ds x} tar "" "" "\&"
.TH \*(x}
.SH NAME
\f4tar\f1 \- tape file archiver
.SH SYNOPSIS
.nf
\f4/usr/sbin/tar \-c\f1[\f4vwfbL\f1[\f2#\f1s]] \f2device\f1 \f2block\f1 \f2files ...
\f4/usr/sbin/tar \-r\f1[\f4vwfbL\f1[\f2#\f1s]] \f2device\f1 \f2block\f1 \f2files ...\f1
\f4/usr/sbin/tar \-t\f1[\f4vfL\f1[\f2#\f1s] \f2device\f1 [\f2files ...\f1]
\f4/usr/sbin/tar \-u\f1[\f4vwfbL\f1[\f2#\f1s]] \f2device\f1 \f2block\f1 \f2files ...\f1
\f4/usr/sbin/tar \-x\f1[\f4lmovwfL\f1[\f2#\f1s]] \f2device\f1 [\f2files ...\f1]
.fi
.SH DESCRIPTION
\f4tar\fP
saves and restores files
on magnetic tape.
Its actions are controlled by the
.I key\^
argument.
The
.I key\^
is a string of characters containing
one function letter
(\f4c\f1, \f4r\f1, \f4t\f1, \f4u\f1, or \f4x\f1) and possibly followed by
one or more function modifiers
(\f4v\f1, \f4w\f1, \f4f\f1, \f4b\f1, and \f2#\f1).
Other arguments to the command are
.I files\^
(or directory
names)
specifying which files are to be dumped or restored.
In all cases, appearance of a directory name refers to
the files and (recursively) subdirectories of that directory.
.PP
The function portion of
the key is specified by one of the following letters:
.PP
.PD 0
.TP 8
\f4c\f1
Create a new tape; writing begins at the beginning
of the tape, instead of after the last file.
This key implies the
\f4r\f1
key.
.TP
\f4r\f1
Replace.  The named
.I files\^
are written
on the end of the tape.
The
\f4c\f1
and
\f4u\f1
functions imply this function.
.TP
\f4t\f1
Table.  
The names and other information for the specified files are listed each 
time that they occur on the tape.  The listing is similar to the
format produced by the \f4ls -l\f1 command.
If no
.I files\^
argument is given,
all the names
on the tape are listed.
.TP
\f4u\f1
Update.  The named
.I files\^
are added to the tape if they
are not already there, or have
been modified since last written on that tape.
This key implies the
\f4r\f1
key.
.TP
\f4x\f1
Extract.  The named
.I files\^
are extracted from the tape.
If a named file matches a directory whose contents
had been written onto the tape, this directory is (recursively) extracted.
Use the file or directory's relative path when appropriate, or
\f4tar\fP
will not find a match.
The owner, modification time, and mode are restored (if possible).
If no
.I files\^
argument is given, the entire content of the
tape is extracted.
Note that if several files with the same name
are on the tape, the last one overwrites
all earlier ones.
.PD
.PP
The characters below may be used in addition to the letter
that selects the desired function.
Use them in the order shown in the synopsis.
Note: the only applicable device information for the 3B2 Computer
is as follows:
.sp0.5
.ce
\f4/dev/mt/ctape [1\^2\^.\|.\|.]\f1
.sp0.5
.PP
.PD 0
.TP 8
\f2#\f4s\f1
This modifier determines the drive on which the tape is mounted
(replace \f2#\f1 with the drive number)
and the speed of the drive (replace \f2s\f1 with \f4l\f1, 
\f4m\f1,
or \f4h\f1 for low, medium or high).  The modifier tells \f4tar\fP
to use a drive other than the default drive, or the drive
specified with the \f4-f\f1 option.  For example, with the
\f45h\f1
modifier, \f4tar\fP would use /dev/mt/5h or /dev/mt0
instead of the default drives /dev/mt/0m or /dev/mt0, respectively.  
However, if for example, \f4-f /dev/rmt0 5h\f1 appeared on the command
line, \f4tar\fP would use /dev/rmt5h or /devmt0.
The default entry is
\f40m\f1.
.TP
\f4v\f1
Verbose.  Normally,
\f4tar\fP
does its work silently.
The
\f4v\f1
(verbose)
option causes it to type the name of each file it treats,
preceded by the function letter.
With the
\f4t\f1
function,
\f4v\f1
gives more information about the
tape entries than just the name.
.TP
\f4w\f1
What.  This causes
\f4tar\fP
to print the action to be taken, followed by the name of the file, and then
wait for the user's confirmation.
If a word beginning with
\f4y\f1
is given, the action is performed.
Any other input means
no.  This is not valid with the
\f4t\f1
key.
.TP
\f4f\f1
File.  This causes
\f4tar\fP
to use the \f2device\f1 argument as the name of the archive instead
of /dev/mt/0m or /dev/mt0.
If the name of the file is
\f4\-\f1,
\f4tar\fP
writes to the
standard output or reads from the standard input, whichever is
appropriate.
Thus,
\f4tar\fP
can be used as the head or tail of a pipeline.
\f4tar\fP
can also be used to move hierarchies with the command:
.PD
.PP
.RS
.RS
\f4cd \f2fromdir\fP; tar cf - .(cd \f2todir\fP; tar xf \-)\f1
.RE
.RE
.PP
.PD 0
.TP 8
\f4b\f1
Blocking Factor.  This causes
\f4tar\fP
to use the \f2block\f1 argument as the blocking factor for tape
records.
The default is 1, the maximum is 20.
This function should not be supplied when operating on regular
archives or block special devices.
It is mandatory however, when reading archives on raw magnetic 
tape archives (see
\f4f\f1
above).
The block size is determined automatically when reading
tapes created on block special devices (key letters
\f4x\f1
and
\f4t\f1).
.TP
\f4l\f1
Link.  This tells
\f4tar\fP
to complain if it cannot resolve all of the links
to the files being dumped.
If
\f4l\f1
is not specified, no
error messages are printed.
.TP
\f4m\f1
Modify.  This tells
\f4tar\fP
to not restore the modification times.  The modification time 
of the file will be the time of extraction.
.TP
\f4o\f1
Ownership.  This causes extracted files to take on the
user and group identifier of the user running the program, rather
than those on tape.  This is only valid with the
\f4x\f1
key.
.TP
\f4L\f1
Follow symbolic links.
This causes symbolic links to be followed.
By default, symbolic links are not followed.
.PD
.SH FILES
\f4/dev/mt/*
.br
/dev/mt*
.br
/dev/mt/ctape
.br
/dev/mt/0m
.br
/dev/rmt/0m
.br
/tmp/tar\(**\f1
.PP
.RE
.SH SEE ALSO
\f4ar\fP(1), \f4cpio\fP(1), \f4ls\fP(1).
.SH DIAGNOSTICS
Complaints about bad key characters and tape read/write errors.
.br
Complaints if enough memory is not available to hold
the link tables.
.br
.ne 10
.SH NOTES
There is no way to ask for the
.IR n -th
occurrence of a file.
.br
Tape errors are handled ungracefully.
.br
The
\f4u\f1
option can be slow.
.br
The
\f4b\f1
option should not be used with archives that are
going to be updated.
The current magnetic tape driver cannot
backspace raw magnetic tape.
If the archive is on a disk file, the
\f4b\f1
option should not be used at all, because updating
an archive stored on disk can destroy it.
.br
The current limit on file name length is
100 characters.
.br
\f4tar\fP doesn't copy empty directories or special files.
.br
.\"	@(#)tar.1	5.2 of 5/18/82
.Ee
