2 .\" Copyright (c) 1996 SigmaSoft, Th. Lockert
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
13 .\" 3. All advertising materials mentioning features or use of this software
14 .\" must display the following acknowledgement:
15 .\" This product includes software developed by SigmaSoft, Th. Lockert.
16 .\" 4. The name of the author may not be used to endorse or promote products
17 .\" derived from this software without specific prior written permission
19 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 .\" $OpenBSD: tar.1,v 1.33 2001/05/01 17:58:01 aaron Exp $
44 .Op Cm befhjmopqsvwyzHLOPXZ014578
49 .\" XXX how to do this right?
56 command creates, adds files to, or extracts files from an
62 archive is often stored on a magnetic tape, but can be
63 stored equally well on a floppy, CD-ROM, or in a regular disk file.
65 One of the following flags must be present:
66 .Bl -tag -width indent
68 Create new archive, or overwrite an existing archive,
69 adding the specified files to it.
71 Append the named new files to existing archive.
72 Note that this will only work on media on which an end-of-file mark
75 List contents of archive.
76 If any files are named on the
77 command line, only those files will be listed.
82 Extract files from archive.
83 If any files are named on the
84 command line, only those files will be extracted from the
86 If more than one copy of a file exists in the
87 archive, later copies will overwrite earlier copies during
89 The file mode and modification time are preserved
91 The file mode is subject to modification by the
95 In addition to the flags mentioned above, any of the following
97 .Bl -tag -width indent
98 .It Fl b Ar "blocking factor"
99 Set blocking factor to use for the archive, with 512 byte blocks.
100 The default is 20, the maximum is 126.
101 Archives with a blocking factor larger 63 violate the
103 standard and will not be portable to all systems.
105 Stop after first error.
107 Filename where the archive is stored.
111 Follow symbolic links as if they were normal files
114 Compress archives using
117 Do not preserve modification time.
123 Do not write directory information that the older (V7) style
130 Preserve user and group ID as well as file mode regardless of
133 The setuid and setgid bits are only preserved if the user is
135 Only meaningful in conjunction with the
139 Select the first archive member that matches each
142 No more than one archive member is matched for each
144 When members of type directory are matched, the file hierarchy rooted at that
145 directory is also matched.
147 Modify the file or archive member names specified by the
151 operands according to the substitution expression
153 using the syntax of the
155 utility regular expressions.
156 The format of these regular expressions are:
161 is a basic regular expression and
163 can contain an ampersand
168 is a digit) back-references,
169 or subexpression matching.
172 string may also contain newline characters.
173 Any non-null character can be used as a delimiter
178 expressions can be specified.
179 The expressions are applied in the order they are specified on the
180 command line, terminating with the first successful substitution.
181 The optional trailing
183 continues to apply the substitution expression to the pathname substring
184 which starts with the first character following the end of the last successful
186 The first unsuccessful substitution stops the operation of the
189 The optional trailing
191 will cause the final result of a successful substitution to be written to
193 in the following format:
195 .Dl <original pathname> >> <new pathname>
197 File or archive member names that substitute to the empty string
198 are not selected and will be skipped.
200 Verbose operation mode.
202 Interactively rename files.
205 to prompt the user for the filename to use when storing or
206 extracting files in an archive.
208 Compress archives using
211 Compress archive using
213 .It Fl C Ar directory
214 This is a positional argument which sets the working directory for the
216 When extracting, files will be extracted into
217 the specified directory; when creating, the specified files will be matched
220 Follow symlinks given on command line only.
224 Do not strip leading slashes
227 The default is to strip leading slashes.
229 This is a positional argument which reads the names of files to
230 archive or extract from the given file, one per line.
232 Do not cross mount points in the file system.
234 Compress archive using
240 can be used to select one of the compiled-in backup devices,
241 .Pa /dev/rst Ns Ar N .
243 .Bl -tag -width TMPDIR
245 Path in which to store temporary files.
247 Default tape device to use instead of
251 .Bl -tag -width "/dev/sa0"
258 utility will exit with one of the following values:
261 All files were processed successfully.
268 cannot create a file or a link when extracting an archive or cannot
269 find a file while writing an archive, or cannot preserve the user
270 ID, group ID, file mode, or access and modification times when the
272 option is specified, a diagnostic message is written to standard
273 error and a non-zero exit value will be returned, but processing
277 cannot create a link to a file,
279 will not create a second copy of the file.
281 If the extraction of a file from an archive is prematurely terminated
282 by a signal or error,
284 may have only partially extracted the file the user wanted.
285 Additionally, the file modes of extracted files and directories may
286 have incorrect file bits, and the modification and access times may
289 If the creation of an archive is prematurely terminated by a signal
292 may have only partially created the archive which may violate the
293 specific archive format specification.
297 flag is not portable to other versions of
299 where it may have a different meaning.
306 command first appeared in
310 at the University of California, San Diego.