BSD 4_3_Tahoe development
[unix-history] / usr / man / cat1 / tar.0
CommitLineData
362b077f
C
1
2
3
4TAR(1) UNIX Programmer's Manual TAR(1)
5
6
7
8N\bNA\bAM\bME\bE
9 tar - tape archiver
10
11S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
12 t\bta\bar\br [ key ] [ name ... ]
13
14D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
15 _\bT_\ba_\br saves and restores multiple files on a single file (usu-
16 ally a magnetic tape, but it can be any file). _\bT_\ba_\br's actions
17 are controlled by the _\bk_\be_\by argument. The _\bk_\be_\by is a string of
18 characters containing at most one function letter and possi-
19 bly one or more function modifiers. Other arguments to _\bt_\ba_\br
20 are file or directory names specifying which files to dump
21 or restore. In all cases, appearance of a directory name
22 refers to the files and (recursively) subdirectories of that
23 directory.
24
25 The function portion of the key is specified by one of the
26 following letters:
27
28 r\br The named files are written on the end of the tape.
29 The c\bc function implies this.
30
31 x\bx The named files are extracted from the tape. If the
32 named file matches a directory whose contents had
33 been written onto the tape, this directory is
34 (recursively) extracted. The owner, modification
35 time, and mode are restored (if possible). If no
36 file argument is given, the entire content of the
37 tape is extracted. Note that if multiple entries
38 specifying the same file are on the tape, the last
39 one overwrites all earlier.
40
41 t\bt The names of the specified files are listed each
42 time they occur on the tape. If no file argument is
43 given, all of the names on the tape are listed.
44
45 u\bu The named files are added to the tape if either they
46 are not already there or have been modified since
47 last put on the tape.
48
49 c\bc Create a new tape; writing begins on the beginning
50 of the tape instead of after the last file. This
51 command implies r\br.
52
53 The following characters may be used in addition to the
54 letter which selects the function desired.
55
56 o\bo On output, tar normally places information speci-
57 fying owner and modes of directories in the
58 archive. Former versions of tar, when encounter-
59 ing this information will give error message of
60
61
62
63Printed 7/9/88 May 23, 1988 1
64
65
66
67
68
69
70TAR(1) UNIX Programmer's Manual TAR(1)
71
72
73
74 the form
75 "<name>/: cannot create".
76 This modifier will suppress the directory informa-
77 tion.
78
79 p\bp This modifier says to restore files to their ori-
80 ginal modes, ignoring the present _\bu_\bm_\ba_\bs_\bk(2).
81 Setuid and sticky information will also be
82 restored to the super-user.
83
84 0\b0,\b, .\b..\b..\b.,\b, 9\b9 This modifier selects an alternate drive on which
85 the tape is mounted. The default is drive 0 at
86 1600 bpi, which is normally /dev/rmt8.
87
88 v\bv Normally _\bt_\ba_\br does its work silently. The v\bv (ver-
89 bose) option makes _\bt_\ba_\br print the name of each file
90 it treats preceded by the function letter. With
91 the t\bt function, the verbose option gives more
92 information about the tape entries than just their
93 names.
94
95 w\bw _\bT_\ba_\br prints the action to be taken followed by file
96 name, then wait for user confirmation. If a word
97 beginning with `y' is given, the action is done.
98 Any other input means don't do it.
99
100 f\bf _\bT_\ba_\br uses the next argument as the name of the
101 archive instead of /dev/rmt?. If the name of the
102 file is `-', tar writes to standard output or
103 reads from standard input, whichever is appropri-
104 ate. Thus, _\bt_\ba_\br can be used as the head or tail of
105 a filter chain. _\bT_\ba_\br can also be used to move
106 hierarchies with the command
107 cd fromdir; tar cf - . | (cd todir; tar xf -)
108
109 b\bb _\bT_\ba_\br uses the next argument as the blocking factor
110 for tape records. The default is 20 (the maximum).
111 This option should only be used with raw magnetic
112 tape archives (See f\bf above). The block size is
113 determined automatically when reading tapes (key
114 letters `x' and `t').
115
116 s\bs tells tar to strip off any leading slashes from
117 pathnames.
118
119 l\bl tells _\bt_\ba_\br to complain if it cannot resolve all of
120 the links to the files dumped. If this is not
121 specified, no error messages are printed.
122
123 m\bm tells _\bt_\ba_\br not to restore the modification times.
124 The modification time will be the time of extrac-
125 tion.
126
127
128
129Printed 7/9/88 May 23, 1988 2
130
131
132
133
134
135
136TAR(1) UNIX Programmer's Manual TAR(1)
137
138
139
140 h\bh Force _\bt_\ba_\br to follow symbolic links as if they were
141 normal files or directories. Normally, _\bt_\ba_\br does
142 not follow symbolic links.
143
144 B\bB Forces input and output blocking to 20 blocks per
145 record. This option was added so that _\bt_\ba_\br can
146 work across a communications channel where the
147 blocking may not be maintained.
148
149 C\bC If a file name is preceded by -\b-C\bC, then _\bt_\ba_\br will
150 perform a _\bc_\bh_\bd_\bi_\br(2) to that file name. This allows
151 multiple directories not related by a close common
152 parent to be archived using short relative path
153 names. For example, to archive files from
154 /usr/include and from /etc, one might use
155 tar c -C /usr include -C / etc
156
157 Previous restrictions dealing with _\bt_\ba_\br's inability to prop-
158 erly handle blocked archives have been lifted.
159
160F\bFI\bIL\bLE\bES\bS
161 /dev/rmt?
162 /tmp/tar*
163
164S\bSE\bEE\bE A\bAL\bLS\bSO\bO
165 tar(5)
166
167D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS
168 Complaints about bad key characters and tape read/write
169 errors.
170 Complaints if enough memory is not available to hold the
171 link tables.
172
173B\bBU\bUG\bGS\bS
174 There is no way to ask for the _\bn-th occurrence of a file.
175 Tape errors are handled ungracefully.
176 The u\bu option can be slow.
177 The current limit on file name length is 100 characters.
178 There is no way selectively to follow symbolic links.
179 When extracting tapes created with the r\br or u\bu options,
180 directory modification times may not be set correctly.
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195Printed 7/9/88 May 23, 1988 3
196
197
198