1 .\" $OpenBSD: cpio.1,v 1.34 2011/09/03 22:59:08 jmc 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 .Dd $Mdocdate: September 3 2011 $
31 .Nd copy file archives in and out
40 .No \*(Lt Ar name-list
44 .Op Fl 6BbcdfjmrSstuvZz
55 .Ar destination-directory
56 .No \*(Lt Ar name-list
60 command copies files to and from a
64 The options are as follows:
68 Reads the list of files to store in the
69 archive from standard input, and writes the archive on standard
73 Append to the specified archive.
75 Reset the access times on files that have been copied to the
78 Set block size of output to 5120 bytes.
80 Set the block size of output to
85 header for portability.
87 Use the specified file as the input for the archive.
89 Write the archive in the specified format.
90 Recognized formats are:
92 .Bl -tag -width sv4cpio -compact
111 Compress archive using the bzip2 format.
112 The bzip2 utility must be installed separately.
114 Follow symbolic links.
116 Use the specified file name as the archive to write to.
118 Be verbose about operations.
119 List filenames as they are written to the archive.
121 Compress archive using
125 Compress archive using
130 Restore files from an archive.
131 Reads the archive file from
132 standard input and extracts files matching the
134 that were specified on the command line.
141 Set the block size of the archive being read to 5120 bytes.
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 Read archive written with a block size of
150 Expect the archive headers to be in ASCII format.
152 Create any intermediate directories as needed during
155 Read list of file name patterns to extract or list from
157 .It Fl F Ar archive , Fl I Ar archive
158 Use the specified file as the input for the archive.
160 Restore all files except those matching the
162 given on the command line.
164 Read an archive of the specified format.
165 Recognized formats are:
167 .Bl -tag -width sv4cpio -compact
186 Uncompress archive using the bzip2 format.
187 The bzip2 utility must be installed separately.
189 Restore modification times on files.
191 Rename restored files interactively.
193 Swap words after reading data from the archive.
195 Swap bytes after reading data from the archive.
197 Only list the contents of the archive, no files or
198 directories will be created.
200 Overwrite files even when the file in the archive is
201 older than the one that will be overwritten.
203 Be verbose about operations.
204 List filenames as they are copied in from the archive.
206 Uncompress archive using
210 Uncompress archive using
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 Follow symbolic links.
229 When possible, link files rather than creating an
232 Restore modification times on files.
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.
244 Path in which to store temporary files.
249 utility exits with one of the following values:
251 .Bl -tag -width Ds -offset indent -compact
253 All files were processed successfully.
260 cannot create a file or a link when extracting an archive or cannot
261 find a file while writing an archive, or cannot preserve the user
262 ID, group ID, file mode, or access and modification times when the
264 option is specified, a diagnostic message is written to standard
265 error and a non-zero exit value will be returned, but processing
269 cannot create a link to a file,
271 will not create a second copy of the file.
273 If the extraction of a file from an archive is prematurely terminated
274 by a signal or error,
276 may have only partially extracted the file the user wanted.
277 Additionally, the file modes of extracted files and directories may
278 have incorrect file bits, and the modification and access times may
281 If the creation of an archive is prematurely terminated by a signal
284 may have only partially created the archive, which may violate the
285 specific archive format specification.
290 Keith Muller at the University of California, San Diego.
292 Different file formats have different maximum file sizes.
293 It is recommended that a format such as cpio or ustar
294 be used for larger files.
295 .Bl -column "File format" "Maximum file size" -offset indent
296 .It Sy "File format" Ta Sy "Maximum file size"
297 .It bcpio Ta "4 Gigabytes"
298 .It sv4cpio Ta "4 Gigabytes"
299 .It cpio Ta "8 Gigabytes"
300 .It tar Ta "8 Gigabytes"
301 .It ustar Ta "8 Gigabytes"
308 options are currently not implemented.