]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - bin/pax/cpio.1
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.git] / bin / pax / cpio.1
1 .\"-
2 .\" Copyright (c) 1997 SigmaSoft, Th. Lockert
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
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
18 .\"
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.
29 .\"
30 .\"     $OpenBSD: cpio.1,v 1.16 2001/05/01 17:58:01 aaron Exp $
31 .\" $FreeBSD$
32 .\"
33 .Dd February 16, 1997
34 .Dt CPIO 1
35 .Os
36 .Sh NAME
37 .Nm cpio
38 .Nd copy file archives in and out
39 .Sh SYNOPSIS
40 .Nm
41 .Fl o
42 .Op Fl aABcLvzZ
43 .Op Fl C Ar bytes
44 .Op Fl F Ar archive
45 .Op Fl H Ar format
46 .Op Fl O Ar archive
47 .No < Ar name-list
48 .Op No > Ar archive
49 .Nm
50 .Fl i
51 .Op Fl bBcdfmrsStuvzZ6
52 .Op Fl C Ar bytes
53 .Op Fl E Ar file
54 .Op Fl F Ar archive
55 .Op Fl H Ar format
56 .Op Fl I Ar archive
57 .Op Ar pattern ...
58 .Op No < Ar archive
59 .Nm
60 .Fl p
61 .Op Fl adlLmuv
62 .Ar destination-directory
63 .No < Ar name-list
64 .Sh DESCRIPTION
65 The
66 .Nm
67 command copies files to and from a
68 .Nm
69 archive.
70 .Pp
71 The options are as follows:
72 .Bl -tag -width indent
73 .It Fl o
74 Create an archive.
75 Reads the list of files to store in the
76 archive from standard input, and writes the archive on standard
77 output.
78 .Bl -tag -width indent
79 .It Fl a
80 Reset the access times on files that have been copied to the
81 archive.
82 .It Fl A
83 Append to the specified archive.
84 .It Fl B
85 Set block size of output to 5120 bytes.
86 .It Fl c
87 Use
88 .Tn ASCII
89 format for
90 .Nm
91 header for portability.
92 .It Fl C Ar bytes
93 Set the block size of output to
94 .Ar bytes .
95 .It Fl F Ar archive
96 .It Fl O Ar archive
97 Use the specified file name as the archive to write to.
98 .It Fl H Ar format
99 Write the archive in the specified format.
100 Recognized formats are:
101 .Pp
102 .Bl -tag -width sv4cpio -compact
103 .It Cm bcpio
104 Old binary
105 .Nm
106 format.
107 .It Cm cpio
108 Old octal character
109 .Nm
110 format.
111 .It Cm sv4cpio
112 .Tn SVR4
113 hex
114 .Nm
115 format.
116 .It Cm tar
117 Old tar format.
118 .It Cm ustar
119 .Tn POSIX
120 ustar format.
121 .El
122 .It Fl L
123 Follow symbolic links.
124 .It Fl v
125 Be verbose about operations.
126 List filenames as they are written to the archive.
127 .It Fl z
128 Compress archive using
129 .Xr gzip 1
130 format.
131 .It Fl Z
132 Compress archive using
133 .Xr compress 1
134 format.
135 .El
136 .It Fl i
137 Restore files from an archive.
138 Reads the archive file from
139 standard input and extracts files matching the
140 .Ar patterns
141 that were specified on the command line.
142 .Bl -tag -width indent
143 .It Fl b
144 Do byte and word swapping after reading in data from the
145 archive, for restoring archives created on systems with
146 a different byte order.
147 .It Fl B
148 Set the block size of the archive being read to 5120 bytes.
149 .It Fl c
150 Expect the archive headers to be in
151 .Tn ASCII
152 format.
153 .It Fl C Ar bytes
154 Read archive written with a block size of
155 .Ar bytes .
156 .It Fl d
157 Create any intermediate directories as needed during
158 restore.
159 .It Fl E Ar file
160 Read list of file name patterns to extract or list from
161 .Ar file .
162 .It Fl f
163 Restore all files except those matching the
164 .Ar patterns
165 given on the command line.
166 .It Fl F Ar archive , Fl I Ar archive
167 Use the specified file as the input for the archive.
168 .It Fl H Ar format
169 Read an archive of the specified format.
170 Recognized formats are:
171 .Pp
172 .Bl -tag -width sv4cpio -compact
173 .It Cm bcpio
174 Old binary
175 .Nm
176 format.
177 .It Cm cpio
178 Old octal character
179 .Nm
180 format.
181 .It Cm sv4cpio
182 .Tn SVR4
183 hex
184 .Nm
185 format.
186 .It Cm tar
187 Old tar format.
188 .It Cm ustar
189 .Tn POSIX
190 ustar format.
191 .El
192 .It Fl m
193 Restore modification times on files.
194 .It Fl r
195 Rename restored files interactively.
196 .It Fl s
197 Swap bytes after reading data from the archive.
198 .It Fl S
199 Swap words after reading data from the archive.
200 .It Fl t
201 Only list the contents of the archive, no files or
202 directories will be created.
203 .It Fl u
204 Overwrite files even when the file in the archive is
205 older than the one that will be overwritten.
206 .It Fl v
207 Be verbose about operations.
208 List filenames as they are copied in from the archive.
209 .It Fl z
210 Uncompress archive using
211 .Xr gzip 1
212 format.
213 .It Fl Z
214 Uncompress archive using
215 .Xr compress 1
216 format.
217 .It Fl 6
218 Process old-style
219 .Nm
220 format archives.
221 .El
222 .It Fl p
223 Copy files from one location to another in a single pass.
224 The list of files to copy are read from standard input and
225 written out to a directory relative to the specified
226 .Ar directory
227 argument.
228 .Bl -tag -width indent
229 .It Fl a
230 Reset the access times on files that have been copied.
231 .It Fl d
232 Create any intermediate directories as needed to write
233 the files at the new location.
234 .It Fl l
235 When possible, link files rather than creating an
236 extra copy.
237 .It Fl L
238 Follow symbolic links.
239 .It Fl m
240 Restore modification times on files.
241 .It Fl u
242 Overwrite files even when the original file being copied is
243 older than the one that will be overwritten.
244 .It Fl v
245 Be verbose about operations.
246 List filenames as they are copied.
247 .El
248 .El
249 .Sh ENVIRONMENT
250 .Bl -tag -width TMPDIR
251 .It Ev TMPDIR
252 Path in which to store temporary files.
253 .El
254 .Sh EXIT STATUS
255 The
256 .Nm
257 utility will exit with one of the following values:
258 .Bl -tag -width 2n
259 .It 0
260 All files were processed successfully.
261 .It 1
262 An error occurred.
263 .El
264 .Pp
265 Whenever
266 .Nm
267 cannot create a file or a link when extracting an archive or cannot
268 find a file while writing an archive, or cannot preserve the user
269 ID, group ID, file mode, or access and modification times when the
270 .Fl p
271 option is specified, a diagnostic message is written to standard
272 error and a non-zero exit value will be returned, but processing
273 will continue.
274 In the case where
275 .Nm
276 cannot create a link to a file,
277 .Nm
278 will not create a second copy of the file.
279 .Pp
280 If the extraction of a file from an archive is prematurely terminated
281 by a signal or error,
282 .Nm
283 may have only partially extracted the file the user wanted.
284 Additionally, the file modes of extracted files and directories may
285 have incorrect file bits, and the modification and access times may
286 be wrong.
287 .Pp
288 If the creation of an archive is prematurely terminated by a signal
289 or error,
290 .Nm
291 may have only partially created the archive which may violate the
292 specific archive format specification.
293 .Sh SEE ALSO
294 .Xr pax 1 ,
295 .Xr tar 1
296 .Sh AUTHORS
297 .An Keith Muller
298 at the University of California, San Diego.
299 .Sh BUGS
300 The
301 .Fl s
302 and
303 .Fl S
304 options are currently not implemented.