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.17 1998/09/23 00:13:49 aaron Exp $
40 .No [-]{crtux}[befhmopvwzHLPXZ014578]
43 .\" XXX how to do this right?
55 command creates, adds files to, or extracts files from an
56 archive file in \*Qtar\*U format. A tar archive is often
57 stored on a magnetic tape, but can be a floppy or a regular
60 One of the following flags must be present:
63 Create new archive, or overwrite an existing archive,
64 adding the specified files to it.
66 Append the named new files to existing archive. Note that
67 this will only work on media on which an end-of-file mark
70 List contents of archive. If any files are named on the
71 command line, only those files will be listed.
76 Extract files from archive. If any files are named on the
77 command line, only those files will be extracted from the
78 archive. If more than one copy of a file exists in the
79 archive, later copies will overwrite earlier copies during
80 extraction. The file mode and modification time are preserved
81 if possible. The file mode is subject to modification by the
85 In addition to the flags mentioned above, any of the following
88 .It Fl b Ar "blocking factor"
89 Set blocking factor to use for the archive.
91 uses 512 byte blocks. The default is 20, the maximum is 126.
92 Archives with a blocking factor larger 63 violate the
94 standard and will not be portable to all systems.
96 Stop after first error.
98 Filename where the archive is stored. Defaults to
101 Follow symbolic links as if they were normal files
104 Do not preserve modification time.
106 Write old-style (non-POSIX) archives.
108 Don't write directory information that the older (V7) style
115 Preserve user and group ID as well as file mode regardless of
118 The setuid and setgid bits are only preserved if the user is
119 the superuser. Only meaningful in conjunction with the
123 Modify the file or archive member names specified by the
127 operands according to the substitution expression
129 using the syntax of the
131 utility regular expressions.
132 The format of these regular expressions are:
137 is a basic regular expression and
139 can contain an ampersand (&), \\n (where n is a digit) back-references,
140 or subexpression matching.
143 string may also contain
146 Any non-null character can be used as a delimiter (/ is shown here).
149 expressions can be specified.
150 The expressions are applied in the order they are specified on the
151 command line, terminating with the first successful substitution.
152 The optional trailing
154 continues to apply the substitution expression to the pathname substring
155 which starts with the first character following the end of the last successful
156 substitution. The first unsuccessful substitution stops the operation of the
159 The optional trailing
161 will cause the final result of a successful substitution to be written to
163 in the following format:
164 .Dl <original pathname> >> <new pathname>
165 File or archive member names that substitute to the empty string
166 are not selected and will be skipped.
168 Verbose operation mode.
170 Interactively rename files. This option causes
172 to prompt the user for the filename to use when storing or
173 extracting files in an archive.
175 Compress archive using gzip.
176 .It Fl C Ar directory
177 This is a positional argument which sets the working directory for the
178 following files. When extracting, files will be extracted into
179 the specified directory; when creating, the specified files will be matched
182 Follow symlinks given on command line only.
186 Do not strip leading slashes (``/'') from pathnames.
187 The default is to strip leading slashes.
189 Do not cross mount points in the file system.
191 Compress archive using compress.
196 can be used to select one of the compiled-in backup devices,
199 .Bl -tag -width "/dev/rst0"
207 Keith Muller at the University of California, San Diego.
210 will exit with one of the following values:
213 All files were processed successfully.
220 cannot create a file or a link when extracting an archive or cannot
221 find a file while writing an archive, or cannot preserve the user
222 ID, group ID, file mode or access and modification times when the
224 option is specified, a diagnostic message is written to standard
225 error and a non-zero exit value will be returned, but processing
226 will continue. In the case where
228 cannot create a link to a file,
230 will not create a second copy of the file.
232 If the extraction of a file from an archive is prematurely terminated
233 by a signal or error,
235 may have only partially extracted the file the user wanted.
236 Additionally, the file modes of extracted files and directories may
237 have incorrect file bits, and the modification and access times may
240 If the creation of an archive is prematurely terminated by a signal
243 may have only partially created the archive which may violate the
244 specific archive format specification.