BSD 2 development
[unix-history] / tar.1
CommitLineData
9c136ee0
BJ
1.TH TAR 1
2.SH NAME
3tar \- tape archiver
4.SH SYNOPSIS
5.B tar
6[ key ] [ name ... ]
7.SH DESCRIPTION
8.I Tar
9saves and restores files
10on magtape.
11Its actions are controlled by the
12.I key
13argument.
14The
15.I key
16is a string of characters containing
17at most one function letter and possibly
18one or more function modifiers.
19Other arguments to the command are file or directory
20names specifying which files are to be dumped or restored.
21In all cases, appearance of a directory name refers to
22the files and (recursively) subdirectories of that directory.
23.PP
24The function portion of
25the key is specified by one of the following letters:
26.TP 8
27.B r
28The named files
29are written
30on the end of the tape.
31The
32.B c
33function implies this.
34.TP 8
35.B x
36The named files are extracted from the tape.
37If the named file matches a directory whose contents
38had been written onto the tape, this directory is (recursively) extracted.
39The owner and mode are restored (if possible).
40If no file argument is given, the entire content of the
41tape is extracted.
42Note that if multiple entries specifying the same file
43are on the tape, the last one overwrites
44all earlier.
45.TP 8
46.B t
47The names of the specified files are listed each time they occur
48on the tape.
49If no file argument is given,
50all of the names on the tape are listed.
51.TP 8
52.B u
53The named files are added to the tape if either they
54are not already there or have
55been modified since last put on the tape.
56.TP 8
57.B c
58Create a new tape; writing begins on the beginning
59of the tape instead of after the last file.
60This command implies
61.B r.
62.PP
63The following characters may be used in addition to the letter
64which selects the function desired.
65.TP 10
66.B 0,...,7
67This
68modifier selects the drive on which the tape is mounted.
69The default is
70.BR 1 .
71.TP 10
72.B v
73Normally
74.I tar
75does its work silently.
76The
77.B v
78(verbose)
79option causes it to type the name of each file it treats
80preceded by the function letter.
81With the
82.B t
83function,
84.B v
85gives more information about the
86tape entries than just the name.
87.TP 10
88.B w
89causes
90.I tar
91to print the action to be taken followed by file name, then
92wait for user confirmation. If a word beginning with `y'
93is given, the action is performed. Any other input means
94don't do it.
95.TP 10
96.B f
97causes
98.I tar
99to use the next argument as the name of the archive instead
100of /dev/mt?.
101If the name of the file is `\-', tar writes to
102standard output or reads from standard input, whichever is
103appropriate. Thus,
104.I tar
105can be used as the head or tail of a filter chain
106.I Tar
107can also be used to move hierarchies with the command
108.ce 1
109cd fromdir; tar cf - . | (cd todir; tar xf -)
110.TP 10
111.B b
112causes
113.I tar
114to use the next argument as the blocking factor for tape
115records. The default is 1, the maximum is 20. This option
116should only be used with raw magnetic tape archives (See
117.B f
118above).
119.TP 10
120.B l
121tells
122.I tar
123to complain if it cannot resolve all of the links
124to the files dumped. If this is not specified, no
125error meesages are printed.
126.PP
127.SH FILES
128/dev/mt?
129.br
130/tmp/tar*
131.SH DIAGNOSTICS
132Complaints about bad key characters and tape read/write errors.
133.br
134Complaints if enough memory is not available to hold
135the link tables.
136.SH BUGS
137There is no way to ask for the
138.IR n -th
139occurrence of a file.
140.br
141Tape errors are handled ungracefully.
142.br
143The
144.B u
145option can be slow.
146.br
147The
148.B b
149option should not be used with archives that are
150going to be updated. The current magtape driver cannot
151backspace raw magtape.
152If the archive is on a disk file the
153.B b
154option should not be used at all, as updating
155an archive stored in this manner can destroy it.
156.br
157The current limit on file name length is
158100 characters.