1 .\" $NetBSD: cpio.1,v 1.10 2007/04/23 18:41:11 christos 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:
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 , -reset-access-time
79 Reset the access times on files that have been copied to the
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 archive using
127 Compress archive using
132 Restore files from an archive.
133 Reads the archive file from
134 standard input and extracts files matching the
136 that were specified on the command line.
139 Do byte and word swapping after reading in data from the
140 archive, for restoring archives created on systems with
141 a different byte order.
143 Set the block size of the archive being read to 5120 bytes.
145 Expect the archive headers to be in ASCII format.
147 Read archive written with a block size of
149 .It Fl d , -make-directories
150 Create any intermediate directories as needed during
152 .It Fl E Ar file , Fl -pattern-file Ar file
153 Read list of file name patterns to extract or list from
155 .It Fl f , -nonmatching
156 Restore all files except those matching the
158 given on the command line.
159 .It Fl F Ar archive , Fl -file Ar archive
161 Use the specified file as the input for the archive.
162 .It Fl H Ar format , Fl -format Ar format
163 Read an archive of the specified format.
164 Recognized formats are:
166 .Bl -tag -width sv4cpio -compact
185 Restore modification times on files.
187 Rename restored files interactively.
189 Swap bytes after reading data from the archive.
190 .It Fl S , -swap-halfwords
191 Swap words after reading data from the archive.
193 Only list the contents of the archive, no files or
194 directories will be created.
195 .It Fl u , -unconditional
196 Overwrite files even when the file in the archive is
197 older than the one that will be overwritten.
199 Be verbose about operations.
200 List filenames as they are copied in from the archive.
202 Uncompress archive using
206 Uncompress archive using
214 .It Fl p , -pass-through
215 Copy files from one location to another in a single pass.
216 The list of files to copy are read from standard input and
217 written out to a directory relative to the specified
222 Reset the access times on files that have been copied.
224 Create any intermediate directories as needed to write
225 the files at the new location.
227 When possible, link files rather than creating an
229 .It Fl L , -dereference
230 Follow symbolic links.
231 .It Fl m , -preserve-modification-time
232 Restore modification times on files.
233 .It Fl u , -unconditional
234 Overwrite files even when the original file being copied is
235 older than the one that will be overwritten.
237 Be verbose about operations.
238 List filenames as they are copied.
240 Do not interpret filenames that contain a
246 ignores filenames that contain
249 With this option, files that contain
256 will exit with one of the following values:
259 All files were processed successfully.
266 cannot create a file or a link when extracting an archive or cannot
267 find a file while writing an archive, or cannot preserve the user
268 ID, group ID, file mode, or access and modification times when the
270 option is specified, a diagnostic message is written to standard
271 error and a non-zero exit value will be returned, but processing
275 cannot create a link to a file,
277 will not create a second copy of the file.
279 If the extraction of a file from an archive is prematurely terminated
280 by a signal or error,
282 may have only partially extracted the file the user wanted.
283 Additionally, the file modes of extracted files and directories may
284 have incorrect file bits, and the modification and access times may
287 If the creation of an archive is prematurely terminated by a signal
290 may have only partially created the archive which may violate the
291 specific archive format specification.
296 Keith Muller at the University of California, San Diego.
302 options are currently not implemented.