version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
CPIO |
|
|
2 |
!!!CPIO |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
---- |
|
|
7 |
!!NAME |
|
|
8 |
|
|
|
9 |
|
|
|
10 |
cpio - copy files to and from archives |
|
|
11 |
!!SYNOPSIS |
|
|
12 |
|
|
|
13 |
|
|
|
14 |
__cpio__ {-o|--create} [[-0acvABLV] [[-C bytes] [[-H format] |
|
|
15 |
[[-M message] [[-O [[[[user@]host:]archive] [[-F |
|
|
16 |
[[[[user@]host:]archive] [[--file=[[[[user@]host:]archive] |
|
|
17 |
[[--format=format] [[--message=message] [[--null] |
|
|
18 |
[[--reset-access-time] [[--verbose] [[--dot] [[--append] |
|
|
19 |
[[--block-size=blocks] [[--dereference] [[--io-size=bytes] |
|
|
20 |
[[--quiet] [[--force-local] [[--rsh-command=command] [[--help] |
|
|
21 |
[[--version] __ |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
__cpio__ {-i|--extract} [[-bcdfmnrtsuvBSV] [[-C bytes] [[-E |
|
|
25 |
file] [[-H format] [[-M message] [[-R [[user][[:.][[group]] [[-I |
|
|
26 |
[[[[user@]host:]archive] [[-F [[[[user@]host:]archive] |
|
|
27 |
[[--file=[[[[user@]host:]archive] [[--make-directories] |
|
|
28 |
[[--nonmatching] [[--preserve-modification-time] |
|
|
29 |
[[--numeric-uid-gid] [[--rename] [[-t|--list] [[--swap-bytes] |
|
|
30 |
[[--swap] [[--dot] [[--unconditional] [[--verbose] |
|
|
31 |
[[--block-size=blocks] [[--swap-halfwords] [[--io-size=bytes] |
|
|
32 |
[[--pattern-file=file] [[--format=format] |
|
|
33 |
[[--owner=[[user][[:.][[group]] [[--no-preserve-owner] |
|
|
34 |
[[--message=message] [[--force-local] |
|
|
35 |
[[--no-absolute-filenames] [[--sparse] [[--only-verify-crc] |
|
|
36 |
[[--quiet] [[--rsh-command=command] [[--help] [[--version] |
|
|
37 |
[[pattern...] [[__ |
|
|
38 |
|
|
|
39 |
|
|
|
40 |
__cpio__ {-p|--pass-through} [[-0adlmuvLV] [[-R |
|
|
41 |
[[user][[:.][[group]] [[--null] [[--reset-access-time] |
|
|
42 |
[[--make-directories] [[--link] [[--quiet] |
|
|
43 |
[[--preserve-modification-time] [[--unconditional] [[--verbose] |
|
|
44 |
[[--dot] [[--dereference] [[--owner=[[user][[:.][[group]] |
|
|
45 |
[[--no-preserve-owner] [[--sparse] [[--help] [[--version] |
|
|
46 |
destination-directory __ |
|
|
47 |
!!DESCRIPTION |
|
|
48 |
|
|
|
49 |
|
|
|
50 |
This manual page documents the GNU version of __cpio__. |
|
|
51 |
__cpio__ copies files into or out of a cpio or tar |
|
|
52 |
archive, which is a file that contains other files plus |
|
|
53 |
information about them, such as their file name, owner, |
|
|
54 |
timestamps, and access permissions. The archive can be |
|
|
55 |
another file on the disk, a magnetic tape, or a pipe. |
|
|
56 |
__cpio__ has three operating modes. |
|
|
57 |
|
|
|
58 |
|
|
|
59 |
In copy-out mode, __cpio__ copies files into an archive. |
|
|
60 |
It reads a list of filenames, one per line, on the standard |
|
|
61 |
input, and writes the archive onto the standard output. A |
|
|
62 |
typical way to generate the list of filenames is with the |
|
|
63 |
__find__ command; you should give __find__ the -depth |
|
|
64 |
option to minimize problems with permissions on directories |
|
|
65 |
that are unwritable or not searchable. |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
In copy-in mode, __cpio__ copies files out of an archive |
|
|
69 |
or lists the archive contents. It reads the archive from the |
|
|
70 |
standard input. Any non-option command line arguments are |
|
|
71 |
shell globbing patterns; only files in the archive whose |
|
|
72 |
names match one or more of those patterns are copied from |
|
|
73 |
the archive. Unlike in the shell, an initial `.' in a |
|
|
74 |
filename does match a wildcard at the start of a pattern, |
|
|
75 |
and a `/' in a filename can match wildcards. If no patterns |
|
|
76 |
are given, all files are extracted. |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
In copy-pass mode, __cpio__ copies files from one |
|
|
80 |
directory tree to another, combining the copy-out and |
|
|
81 |
copy-in steps without actually using an archive. It reads |
|
|
82 |
the list of files to copy from the standard input; the |
|
|
83 |
directory into which it will copy them is given as a |
|
|
84 |
non-option argument. |
|
|
85 |
|
|
|
86 |
|
|
|
87 |
__cpio__ supports the following archive formats: binary, |
|
|
88 |
old ASCII, new ASCII, crc, HPUX binary, HPUX old ASCII, old |
|
|
89 |
tar, and POSIX.1 tar. The binary format is obsolete because |
|
|
90 |
it encodes information about the files in a way that is not |
|
|
91 |
portable between different machine architectures. The old |
|
|
92 |
ASCII format is portable between different machine |
|
|
93 |
architectures, but should not be used on file systems with |
|
|
94 |
more than 65536 i-nodes. The new ASCII format is portable |
|
|
95 |
between different machine architectures and can be used on |
|
|
96 |
any size file system, but is not supported by all versions |
|
|
97 |
of __cpio__; currently, it is only supported by GNU and |
|
|
98 |
Unix System V R4. The crc format is like the new ASCII |
|
|
99 |
format, but also contains a checksum for each file which |
|
|
100 |
__cpio__ calculates when creating an archive and verifies |
|
|
101 |
when the file is extracted from the archive. The HPUX |
|
|
102 |
formats are provided for compatibility with HPUX's cpio |
|
|
103 |
which stores device files differently. |
|
|
104 |
|
|
|
105 |
|
|
|
106 |
The tar format is provided for compatability with the |
|
|
107 |
__tar__ program. It can not be used to archive files with |
|
|
108 |
names longer than 100 characters, and can not be used to |
|
|
109 |
archive |
|
|
110 |
__ |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
By default, __cpio__ creates binary format archives, for |
|
|
114 |
compatibility with older __cpio__ programs. When |
|
|
115 |
extracting from archives, __cpio__ automatically |
|
|
116 |
recognizes which kind of archive it is reading and can read |
|
|
117 |
archives created on machines with a different |
|
|
118 |
byte-order. |
|
|
119 |
|
|
|
120 |
|
|
|
121 |
Some of the options to __cpio__ apply only to certain |
|
|
122 |
operating modes; see the SYNOPSIS section for a list of |
|
|
123 |
which options are allowed in which modes. |
|
|
124 |
|
|
|
125 |
|
|
|
126 |
__OPTIONS__ |
|
|
127 |
|
|
|
128 |
|
|
|
129 |
''-0, --null'' |
|
|
130 |
|
|
|
131 |
|
|
|
132 |
In copy-out and copy-pass modes, read a list of filenames |
|
|
133 |
terminated by a null character instead of a newline, so that |
|
|
134 |
files whose names contain newlines can be archived. GNU |
|
|
135 |
__find__ is one way to produce a list of null-terminated |
|
|
136 |
filenames. |
|
|
137 |
|
|
|
138 |
|
|
|
139 |
''-a, --reset-access-time'' |
|
|
140 |
|
|
|
141 |
|
|
|
142 |
Reset the access times of files after reading them, so that |
|
|
143 |
it does not look like they have just been read. |
|
|
144 |
|
|
|
145 |
|
|
|
146 |
''-A, --append'' |
|
|
147 |
|
|
|
148 |
|
|
|
149 |
Append to an existing archive. Only works in copy-out mode. |
|
|
150 |
The archive must be a disk file specified with the ''-O'' |
|
|
151 |
or ''-F (--file)'' option. |
|
|
152 |
|
|
|
153 |
|
|
|
154 |
''-b, --swap'' |
|
|
155 |
|
|
|
156 |
|
|
|
157 |
In copy-in mode, swap both halfwords of words and bytes of |
|
|
158 |
halfwords in the data. Equivalent to ''-sS''. Use this |
|
|
159 |
option to convert 32-bit integers between big-endian and |
|
|
160 |
little-endian machines. |
|
|
161 |
|
|
|
162 |
|
|
|
163 |
''-B'' |
|
|
164 |
|
|
|
165 |
|
|
|
166 |
Set the I/O block size to 5120 bytes. Initially the block |
|
|
167 |
size is 512 bytes. |
|
|
168 |
|
|
|
169 |
|
|
|
170 |
''--block-size=BLOCK-SIZE'' |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
Set the I/O block size to BLOCK-SIZE * 512 |
|
|
174 |
bytes. |
|
|
175 |
|
|
|
176 |
|
|
|
177 |
''-c'' |
|
|
178 |
|
|
|
179 |
|
|
|
180 |
Use the old portable (ASCII) archive format. |
|
|
181 |
|
|
|
182 |
|
|
|
183 |
''-C IO-SIZE, --io-size=IO-SIZE'' |
|
|
184 |
|
|
|
185 |
|
|
|
186 |
Set the I/O block size to IO-SIZE bytes. |
|
|
187 |
|
|
|
188 |
|
|
|
189 |
''-d, --make-directories'' |
|
|
190 |
|
|
|
191 |
|
|
|
192 |
Create leading directories where needed. |
|
|
193 |
|
|
|
194 |
|
|
|
195 |
''-E FILE, --pattern-file=FILE'' |
|
|
196 |
|
|
|
197 |
|
|
|
198 |
In copy-in mode, read additional patterns specifying |
|
|
199 |
filenames to extract or list from FILE. The lines of FILE |
|
|
200 |
are treated as if they had been non-option arguments to |
|
|
201 |
__cpio__. |
|
|
202 |
|
|
|
203 |
|
|
|
204 |
''-f, --nonmatching'' |
|
|
205 |
|
|
|
206 |
|
|
|
207 |
Only copy files that do not match any of the given |
|
|
208 |
patterns. |
|
|
209 |
|
|
|
210 |
|
|
|
211 |
''-F, --file=archive'' |
|
|
212 |
|
|
|
213 |
|
|
|
214 |
Archive filename to use instead of standard input or output. |
|
|
215 |
To use a tape drive on another machine as the archive, use a |
|
|
216 |
filename that starts with `HOSTNAME:'. The hostname can be |
|
|
217 |
preceded by a username and an `@' to access the remote tape |
|
|
218 |
drive as that user, if you have permission to do so |
|
|
219 |
(typically an entry in that user's `~/.rhosts' |
|
|
220 |
file). |
|
|
221 |
|
|
|
222 |
|
|
|
223 |
''--force-local'' |
|
|
224 |
|
|
|
225 |
|
|
|
226 |
With ''-F'', ''-I'', or ''-O'', take the archive |
|
|
227 |
file name to be a local file even if it contains a colon, |
|
|
228 |
which would ordinarily indicate a remote host |
|
|
229 |
name. |
|
|
230 |
|
|
|
231 |
|
|
|
232 |
''-H FORMAT, --format=FORMAT'' |
|
|
233 |
|
|
|
234 |
|
|
|
235 |
Use archive format FORMAT. The valid formats are listed |
|
|
236 |
below; the same names are also recognized in all-caps. The |
|
|
237 |
default in copy-in mode is to automatically detect the |
|
|
238 |
archive format, and in copy-out mode is |
|
|
239 |
|
|
|
240 |
|
|
|
241 |
bin |
|
|
242 |
|
|
|
243 |
|
|
|
244 |
The obsolete binary format. |
|
|
245 |
|
|
|
246 |
|
|
|
247 |
odc |
|
|
248 |
|
|
|
249 |
|
|
|
250 |
The old (POSIX.1) portable format. |
|
|
251 |
|
|
|
252 |
|
|
|
253 |
newc |
|
|
254 |
|
|
|
255 |
|
|
|
256 |
The new (SVR4) portable format, which supports file systems |
|
|
257 |
having more than 65536 i-nodes. |
|
|
258 |
|
|
|
259 |
|
|
|
260 |
crc |
|
|
261 |
|
|
|
262 |
|
|
|
263 |
The new (SVR4) portable format with a checksum |
|
|
264 |
added. |
|
|
265 |
|
|
|
266 |
|
|
|
267 |
tar |
|
|
268 |
|
|
|
269 |
|
|
|
270 |
The old tar format. |
|
|
271 |
|
|
|
272 |
|
|
|
273 |
ustar |
|
|
274 |
|
|
|
275 |
|
|
|
276 |
The POSIX.1 tar format. Also recognizes GNU __tar__ |
|
|
277 |
archives, which are similar but not identical. |
|
|
278 |
|
|
|
279 |
|
|
|
280 |
hpbin |
|
|
281 |
|
|
|
282 |
|
|
|
283 |
The obsolete binary format used by HPUX's cpio (which stores |
|
|
284 |
device files differently). |
|
|
285 |
|
|
|
286 |
|
|
|
287 |
hpodc |
|
|
288 |
|
|
|
289 |
|
|
|
290 |
The portable format used by HPUX's cpio (which stores device |
|
|
291 |
files differently). |
|
|
292 |
|
|
|
293 |
|
|
|
294 |
''-i, --extract'' |
|
|
295 |
|
|
|
296 |
|
|
|
297 |
Run in copy-in mode. |
|
|
298 |
|
|
|
299 |
|
|
|
300 |
''-I archive'' |
|
|
301 |
|
|
|
302 |
|
|
|
303 |
Archive filename to use instead of standard input. To use a |
|
|
304 |
tape drive on another machine as the archive, use a filename |
|
|
305 |
that starts with `HOSTNAME:'. The hostname can be preceded |
|
|
306 |
by a username and an `@' to access the remote tape drive as |
|
|
307 |
that user, if you have permission to do so (typically an |
|
|
308 |
entry in that user's `~/.rhosts' file). |
|
|
309 |
|
|
|
310 |
|
|
|
311 |
''-k'' |
|
|
312 |
|
|
|
313 |
|
|
|
314 |
Ignored; for compatibility with other versions of |
|
|
315 |
__cpio__. |
|
|
316 |
|
|
|
317 |
|
|
|
318 |
''-l, --link'' |
|
|
319 |
|
|
|
320 |
|
|
|
321 |
Link files instead of copying them, when |
|
|
322 |
possible. |
|
|
323 |
|
|
|
324 |
|
|
|
325 |
''-L, --dereference'' |
|
|
326 |
|
|
|
327 |
|
|
|
328 |
Dereference symbolic links (copy the files that they point |
|
|
329 |
to instead of copying the links). |
|
|
330 |
|
|
|
331 |
|
|
|
332 |
''-m, --preserve-modification-time'' |
|
|
333 |
|
|
|
334 |
|
|
|
335 |
Retain previous file modification times when creating |
|
|
336 |
files. |
|
|
337 |
|
|
|
338 |
|
|
|
339 |
''-M MESSAGE, --message=MESSAGE'' |
|
|
340 |
|
|
|
341 |
|
|
|
342 |
Print MESSAGE when the end of a volume of the backup media |
|
|
343 |
(such as a tape or a floppy disk) is reached, to prompt the |
|
|
344 |
user to insert a new volume. If MESSAGE contains the string |
|
|
345 |
|
|
|
346 |
|
|
|
347 |
''-n, --numeric-uid-gid'' |
|
|
348 |
|
|
|
349 |
|
|
|
350 |
In the verbose table of contents listing, show numeric UID |
|
|
351 |
and GID instead of translating them into names. Also |
|
|
352 |
extracts tar archives using the numeric UID and GID instead |
|
|
353 |
of the user/group names. (__cpio__ archives are always |
|
|
354 |
extracted using the numeric UID and GID.) |
|
|
355 |
|
|
|
356 |
|
|
|
357 |
''--no-absolute-filenames'' |
|
|
358 |
|
|
|
359 |
|
|
|
360 |
In copy-in mode, create all files relative to the current |
|
|
361 |
directory, even if they have an absolute file name in the |
|
|
362 |
archive. |
|
|
363 |
|
|
|
364 |
|
|
|
365 |
''--no-preserve-owner'' |
|
|
366 |
|
|
|
367 |
|
|
|
368 |
In copy-in mode and copy-pass mode, do not change the |
|
|
369 |
ownership of the files; leave them owned by the user |
|
|
370 |
extracting them. This is the default for non-root users, so |
|
|
371 |
that users on System V don't inadvertantly give away |
|
|
372 |
files. |
|
|
373 |
|
|
|
374 |
|
|
|
375 |
''-o, --create'' |
|
|
376 |
|
|
|
377 |
|
|
|
378 |
Run in copy-out mode. |
|
|
379 |
|
|
|
380 |
|
|
|
381 |
''-O archive'' |
|
|
382 |
|
|
|
383 |
|
|
|
384 |
Archive filename to use instead of standard output. To use a |
|
|
385 |
tape drive on another machine as the archive, use a filename |
|
|
386 |
that starts with `HOSTNAME:'. The hostname can be preceded |
|
|
387 |
by a username and an `@' to access the remote tape drive as |
|
|
388 |
that user, if you have permission to do so (typically an |
|
|
389 |
entry in that user's `~/.rhosts' file). |
|
|
390 |
|
|
|
391 |
|
|
|
392 |
''--only-verify-crc'' |
|
|
393 |
|
|
|
394 |
|
|
|
395 |
When reading a CRC format archive in copy-in mode, only |
|
|
396 |
verify the CRC's of each file in the archive, don't actually |
|
|
397 |
extract the files. |
|
|
398 |
|
|
|
399 |
|
|
|
400 |
''-p, --pass-through'' |
|
|
401 |
|
|
|
402 |
|
|
|
403 |
Run in copy-pass mode. |
|
|
404 |
|
|
|
405 |
|
|
|
406 |
''--quiet'' |
|
|
407 |
|
|
|
408 |
|
|
|
409 |
Do not print the number of blocks copied. |
|
|
410 |
|
|
|
411 |
|
|
|
412 |
''-r, --rename'' |
|
|
413 |
|
|
|
414 |
|
|
|
415 |
Interactively rename files. |
|
|
416 |
|
|
|
417 |
|
|
|
418 |
''-R [[user][[:.][[group], --owner |
|
|
419 |
[[user][[:.][[group]'' |
|
|
420 |
|
|
|
421 |
|
|
|
422 |
In copy-out and copy-pass modes, set the ownership of all |
|
|
423 |
files created to the specified user and/or group. Either the |
|
|
424 |
user or the group, or both, must be present. If the group is |
|
|
425 |
omitted but the |
|
|
426 |
|
|
|
427 |
|
|
|
428 |
''--rsh-command=COMMAND'' |
|
|
429 |
|
|
|
430 |
|
|
|
431 |
Notifies __mt__ that it should use COMMAND to communicate |
|
|
432 |
with remote devices instead of ''/usr/bin/ssh'', |
|
|
433 |
''/usr/bin/rsh'', or the command specified by the |
|
|
434 |
environment variable __MT_RSH__. |
|
|
435 |
|
|
|
436 |
|
|
|
437 |
''--sparse'' |
|
|
438 |
|
|
|
439 |
|
|
|
440 |
In copy-in and copy-pass modes, write files with large |
|
|
441 |
blocks of zeros as sparse files. |
|
|
442 |
|
|
|
443 |
|
|
|
444 |
''-s, --swap-bytes'' |
|
|
445 |
|
|
|
446 |
|
|
|
447 |
In copy-in mode, swap the bytes of each halfword (pair of |
|
|
448 |
bytes) in the files. |
|
|
449 |
|
|
|
450 |
|
|
|
451 |
''-S, --swap-halfwords'' |
|
|
452 |
|
|
|
453 |
|
|
|
454 |
In copy-in mode, swap the halfwords of each word (4 bytes) |
|
|
455 |
in the files. |
|
|
456 |
|
|
|
457 |
|
|
|
458 |
''-t, --list'' |
|
|
459 |
|
|
|
460 |
|
|
|
461 |
Print a table of contents of the input. |
|
|
462 |
|
|
|
463 |
|
|
|
464 |
''-u, --unconditional'' |
|
|
465 |
|
|
|
466 |
|
|
|
467 |
Replace all files, without asking whether to replace |
|
|
468 |
existing newer files with older files. |
|
|
469 |
|
|
|
470 |
|
|
|
471 |
''-v, --verbose'' |
|
|
472 |
|
|
|
473 |
|
|
|
474 |
List the files processed, or with ''-t'', give an `ls -l' |
|
|
475 |
style table of contents listing. In a verbose table of |
|
|
476 |
contents of a ustar archive, user and group names in the |
|
|
477 |
archive that do not exist on the local system are replaced |
|
|
478 |
by the names that correspond locally to the numeric UID and |
|
|
479 |
GID stored in the archive. |
|
|
480 |
|
|
|
481 |
|
|
|
482 |
''-V --dot'' |
|
|
483 |
|
|
|
484 |
|
|
|
485 |
Print a |
|
|
486 |
|
|
|
487 |
|
|
|
488 |
''--version'' |
|
|
489 |
|
|
|
490 |
|
|
|
491 |
Print the __cpio__ program version number and |
|
|
492 |
exit. |
|
|
493 |
---- |