1 .\" $NetBSD: cpio.1,v 1.14 2015/12/19 18:48:33 wiz Exp $
3 .\" Copyright (c) 1997 SigmaSoft, Th. Lockert
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 .\" OpenBSD: cpio.1,v 1.14 2000/11/10 17:52:02 aaron Exp
33 .Nd copy file archives in and out
42 .Ar "\*[Lt] name-list"
43 .Op Ar "\*[Gt] archive"
46 .Op Fl 6BbcdfmrSstuvZz
53 .Op Ar "\*[Lt] archive"
57 .Ar destination-directory
58 .Ar "\*[Lt] name-list"
62 command copies files to and from a
65 If the archive is of the form:
66 .Ar [[user@]host:]file
67 then the archive will be processed using
70 The options are as follows:
72 .It Fl o , Fl Fl create
74 Reads the list of files to store in the
75 archive from standard input, and writes the archive on standard
78 .It Fl a , Fl Fl reset-access-time
79 Reset the access times on files that have been copied to the
81 .It Fl A , Fl Fl append
82 Append to the specified archive.
84 Set block size of output to 5120 bytes.
88 header for portability.
90 Set the block size of output to
94 Use the specified file name as the archive to write to.
96 Write the archive in the specified format.
97 Recognized formats are:
99 .Bl -tag -width sv4cpio -compact
118 Follow symbolic links.
120 Be verbose about operations.
121 List filenames as they are written to the archive.
123 Compress/decompress archive using
127 Compress archive using
131 Compress/decompress archive using
135 .It Fl i , Fl Fl extract
136 Restore files from an archive.
137 Reads the archive file from
138 standard input and extracts files matching the
140 that were specified on the command line.
143 Do byte and word swapping after reading in data from the
144 archive, for restoring archives created on systems with
145 a different byte order.
147 Set the block size of the archive being read to 5120 bytes.
149 Expect the archive headers to be in ASCII format.
151 Read archive written with a block size of
153 .It Fl d , Fl Fl make-directories
154 Create any intermediate directories as needed during
156 .It Fl E Ar file , Fl Fl pattern-file Ar file
157 Read list of file name patterns to extract or list from
159 .It Fl f , Fl Fl nonmatching
160 Restore all files except those matching the
162 given on the command line.
163 .It Fl F Ar archive , Fl Fl file Ar archive
165 Use the specified file as the input for the archive.
166 .It Fl H Ar format , Fl Fl format Ar format
167 Read an archive of the specified format.
168 Recognized formats are:
170 .Bl -tag -width sv4cpio -compact
189 Restore modification times on files.
190 .It Fl r , Fl Fl rename
191 Rename restored files interactively.
193 Swap bytes after reading data from the archive.
194 .It Fl S , Fl Fl swap-halfwords
195 Swap words after reading data from the archive.
196 .It Fl t , Fl Fl list
197 Only list the contents of the archive, no files or
198 directories will be created.
199 .It Fl u , Fl Fl unconditional
200 Overwrite files even when the file in the archive is
201 older than the one that will be overwritten.
202 .It Fl v , Fl Fl verbose
203 Be verbose about operations.
204 List filenames as they are copied in from the archive.
206 Uncompress archive using
210 Uncompress archive using
218 .It Fl p , Fl Fl pass-through
219 Copy files from one location to another in a single pass.
220 The list of files to copy are read from standard input and
221 written out to a directory relative to the specified
226 Reset the access times on files that have been copied.
228 Create any intermediate directories as needed to write
229 the files at the new location.
230 .It Fl l , Fl Fl link
231 When possible, link files rather than creating an
233 .It Fl L , Fl Fl dereference
234 Follow symbolic links.
235 .It Fl m , Fl Fl preserve-modification-time
236 Restore modification times on files.
237 .It Fl u , Fl Fl unconditional
238 Overwrite files even when the original file being copied is
239 older than the one that will be overwritten.
240 .It Fl v , Fl Fl verbose
241 Be verbose about operations.
242 List filenames as they are copied.
243 .It Fl Fl force-local
244 Do not interpret filenames that contain a
250 ignores filenames that contain
253 With this option, files that contain
260 will exit with one of the following values:
263 All files were processed successfully.
270 cannot create a file or a link when extracting an archive or cannot
271 find a file while writing an archive, or cannot preserve the user
272 ID, group ID, file mode, or access and modification times when the
274 option is specified, a diagnostic message is written to standard
275 error and a non-zero exit value will be returned, but processing
279 cannot create a link to a file,
281 will not create a second copy of the file.
283 If the extraction of a file from an archive is prematurely terminated
284 by a signal or error,
286 may have only partially extracted the file the user wanted.
287 Additionally, the file modes of extracted files and directories may
288 have incorrect file bits, and the modification and access times may
291 If the creation of an archive is prematurely terminated by a signal
294 may have only partially created the archive which may violate the
295 specific archive format specification.
301 at the University of California, San Diego.
307 options are currently not implemented.