1 .TH CPIO 1L \" -*- nroff -*-
3 cpio \- copy files to and from archives
6 {\-o|\-\-create} [\-0acvABLV] [\-C bytes] [\-H format] [\-M message]
7 [\-O [[user@]host:]archive] [\-F [[user@]host:]archive]
8 [\-\-file=[[user@]host:]archive] [\-\-format=format] [\-\-message=message]
9 [\-\-null] [\-\-reset-access-time] [\-\-verbose] [\-\-dot] [\-\-append]
10 [\-\-block-size=blocks] [\-\-dereference] [\-\-io-size=bytes] [\-\-quiet]
11 [\-\-force\-local] [\-\-help] [\-\-version] < name-list [> archive]
14 {\-i|\-\-extract} [\-bcdfmnrtsuvBSV] [\-C bytes] [\-E file] [\-H format]
15 [\-M message] [\-R [user][:.][group]] [\-I [[user@]host:]archive]
16 [\-F [[user@]host:]archive] [\-\-file=[[user@]host:]archive]
17 [\-\-make-directories] [\-\-nonmatching] [\-\-preserve-modification-time]
18 [\-\-numeric-uid-gid] [\-\-rename] [\-\-list] [\-\-swap-bytes] [\-\-swap] [\-\-dot]
19 [\-\-unconditional] [\-\-verbose] [\-\-block-size=blocks] [\-\-swap-halfwords]
20 [\-\-io-size=bytes] [\-\-pattern-file=file] [\-\-format=format]
21 [\-\-owner=[user][:.][group]] [\-\-no-preserve-owner] [\-\-message=message]
22 [\-\-force\-local] [\-\-no\-absolute\-filenames] [\-\-sparse] [\-\-only\-verify\-crc]
23 [\-\-quiet] [\-\-help] [\-\-version] [pattern...] [< archive]
26 {\-p|\-\-pass-through} [\-0adlmuvLV] [\-R [user][:.][group]]
27 [\-\-null] [\-\-reset-access-time] [\-\-make-directories] [\-\-link] [\-\-quiet]
28 [\-\-preserve-modification-time] [\-\-unconditional] [\-\-verbose] [\-\-dot]
29 [\-\-dereference] [\-\-owner=[user][:.][group]] [\-\-no-preserve-owner]
30 [\-\-sparse] [\-\-help] [\-\-version] destination-directory < name-list
33 documents the GNU version of
36 copies files into or out of a cpio or tar archive, which is a file that
37 contains other files plus information about them, such as their
38 file name, owner, timestamps, and access permissions. The archive can
39 be another file on the disk, a magnetic tape, or a pipe.
41 has three operating modes.
45 copies files into an archive. It reads a list of filenames, one per
46 line, on the standard input, and writes the archive onto the standard
47 output. A typical way to generate the list of filenames is with the
49 command; you should give
51 the \-d option to minimize problems with permissions on
52 directories that are unwritable or not searchable.
56 copies files out of an archive or lists the archive contents. It
57 reads the archive from the standard input. Any non-option command
58 line arguments are shell globbing patterns; only files in the archive
59 whose names match one or more of those patterns are copied from the
60 archive. Unlike in the shell, an initial `.' in a filename does
61 match a wildcard at the start of a pattern, and a `/' in a filename
62 can match wildcards. If no patterns are given, all files are
67 copies files from one directory tree to another, combining the
68 copy-out and copy-in steps without actually using an archive.
69 It reads the list of files to copy from the standard input; the
70 directory into which it will copy them is given as a non-option
74 supports the following archive formats: binary, old ASCII, new
75 ASCII, crc, HPUX binary, HPUX old ASCII, old tar, and POSIX.1 tar.
77 is obsolete because it encodes information about the files in a way
78 that is not portable between different machine architectures.
79 The old ASCII format is portable between different machine architectures,
80 but should not be used on file systems with more than 65536 i-nodes.
81 The new ASCII format is portable between different machine architectures
82 and can be used on any size file system, but is not supported by all
85 currently, it is only supported by GNU and Unix System V R4.
87 like the new ASCII format, but also contains a checksum for each file
90 calculates when creating an archive
91 and verifies when the file is extracted from the archive.
92 The HPUX formats are provided for compatibility with HPUX's cpio which
93 stores device files differently.
95 The tar format is provided for compatibility with
98 program. It can not be used to archive files with names
99 longer than 100 characters, and can not be used to archive "special"
100 (block or character devices) files.
101 The POSIX.1 tar format can not be used to archive files with names longer
102 than 255 characters (less unless they have a "/" in just the right place).
106 creates binary format archives, for compatibility with
110 When extracting from archives,
112 automatically recognizes which kind of archive it is reading and can
113 read archives created on machines with a different byte-order.
115 Some of the options to
117 apply only to certain operating modes; see the SYNOPSIS section for a
118 list of which options are allowed in which modes.
122 In copy-out and copy-pass modes, read a list of filenames terminated
123 by a null character instead of a newline, so that files whose names
124 contain newlines can be archived. GNU
126 is one way to produce a list of null-terminated filenames.
128 .I "\-a, \-\-reset-access-time"
129 Reset the access times of files after reading them, so that it does
130 not look like they have just been read.
133 Append to an existing archive. Only works in copy-out mode. The
134 archive must be a disk file specified with the
141 In copy-in mode, swap both halfwords of words and bytes of halfwords
142 in the data. Equivalent to
144 Use this option to convert 32-bit integers between big-endian and
145 little-endian machines.
148 Set the I/O block size to 5120 bytes. Initially the block size is 512
151 .I "\-\-block-size=BLOCK-SIZE"
152 Set the I/O block size to BLOCK-SIZE * 512 bytes.
155 Use the old portable (ASCII) archive format.
157 .I "\-C IO-SIZE, \-\-io-size=IO-SIZE"
158 Set the I/O block size to IO-SIZE bytes.
160 .I "\-d, \-\-make-directories"
161 Create leading directories where needed.
163 .I "\-E FILE, \-\-pattern-file=FILE"
164 In copy-in mode, read additional patterns specifying filenames to
165 extract or list from FILE. The lines of FILE are treated as if they
166 had been non-option arguments to
169 .I "\-f, \-\-nonmatching"
170 Only copy files that do not match any of the given patterns.
172 .I "\-F, \-\-file=archive"
173 Archive filename to use instead of standard input or output. To use a
174 tape drive on another machine as the archive, use a filename that
175 starts with `HOSTNAME:'. The hostname can be preceded by a
176 username and an `@' to access the remote tape drive as that user, if
177 you have permission to do so (typically an entry in that user's
186 take the archive file name to be a local file even if it contains a
187 colon, which would ordinarily indicate a remote host name.
189 .I "\-H FORMAT, \-\-format=FORMAT"
190 Use archive format FORMAT. The valid formats are listed below;
191 the same names are also recognized in all-caps. The default in
192 copy-in mode is to automatically detect the archive format, and in
193 copy-out mode is "bin".
196 The obsolete binary format.
198 The old (POSIX.1) portable format.
200 The new (SVR4) portable format, which supports file systems having
201 more than 65536 i-nodes.
203 The new (SVR4) portable format with a checksum added.
207 The POSIX.1 tar format. Also recognizes GNU
209 archives, which are similar but not identical.
211 The obsolete binary format used by HPUX's cpio (which stores device files
214 The portable format used by HPUX's cpio (which stores device files differently).
217 .I "\-i, \-\-extract"
221 Archive filename to use instead of standard input. To use a
222 tape drive on another machine as the archive, use a filename that
223 starts with `HOSTNAME:'. The hostname can be preceded by a
224 username and an `@' to access the remote tape drive as that user, if
225 you have permission to do so (typically an entry in that user's
229 Ignored; for compatibility with other versions of
233 Link files instead of copying them, when possible (usable only with the
237 .I "\-L, \-\-dereference"
238 Dereference symbolic links (copy the files that they point to instead
239 of copying the links).
241 .I "\-m, \-\-preserve-modification-time"
242 Retain previous file modification times when creating files.
244 .I "\-M MESSAGE, \-\-message=MESSAGE"
245 Print MESSAGE when the end of a volume of the backup media (such as a
246 tape or a floppy disk) is reached, to prompt the user to insert a new
247 volume. If MESSAGE contains the string "%d", it is replaced by the
248 current volume number (starting at 1).
250 .I "\-n, \-\-numeric-uid-gid"
251 In the verbose table of contents listing, show numeric UID and GID
252 instead of translating them into names.
254 .I " \-\-no-absolute-filenames"
255 In copy-in mode, create all files relative to the current directory,
256 even if they have an absolute file name in the archive.
258 .I " \-\-no-preserve-owner"
259 In copy-in mode and copy-pass mode, do not change the ownership of the
260 files; leave them owned by the user extracting them. This is the
261 default for non-root users, so that users on System V don't
262 inadvertently give away files.
265 Run in copy-out mode.
268 Archive filename to use instead of standard output. To use a tape
269 drive on another machine as the archive, use a filename that starts
270 with `HOSTNAME:'. The hostname can be preceded by a username and an
271 `@' to access the remote tape drive as that user, if you have
272 permission to do so (typically an entry in that user's `~/.rhosts'
275 .I " \-\-only-verify-crc"
276 When reading a CRC format archive in copy-in mode, only verify the
277 CRC's of each file in the archive, don't actually extract the files.
279 .I "\-p, \-\-pass-through"
280 Run in copy-pass mode.
283 Do not print the number of blocks copied.
286 Interactively rename files.
288 .I "\-R [user][:.][group], \-\-owner [user][:.][group]"
289 In copy-out and copy-pass modes, set the ownership of all files created
290 to the specified user and/or group. Either the user or the group, or
291 both, must be present. If the group is omitted but the ":" or "."
292 separator is given, use the given user's login group. Only the
293 super-user can change files' ownership.
296 In copy-out and copy-pass modes, write files with large blocks of zeros
299 .I "\-s, \-\-swap-bytes"
300 In copy-in mode, swap the bytes of each halfword (pair of bytes) in the
303 .I "\-S, \-\-swap-halfwords"
304 In copy-in mode, swap the halfwords of each word (4 bytes) in the
308 Print a table of contents of the input.
310 .I "\-u, \-\-unconditional"
311 Replace all files, without asking whether to replace existing newer
312 files with older files.
314 .I "\-v, \-\-verbose"
315 List the files processed, or with
317 give an `ls \-l' style table of contents listing. In a verbose table
318 of contents of a ustar archive, user and group names in the archive
319 that do not exist on the local system are replaced by the names that
320 correspond locally to the numeric UID and GID stored in the archive.
323 Print a "." for each file processed.
328 program version number and exit.