9070 Remove wanboot from gate
[unleashed.git] / usr / src / man / man1 / cpio.1
blobec808e6bad0a86f2c0efb9cc9bd584c5f989b238
1 '\" te
2 .\" Copyright 1989 AT&T
3 .\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
4 .\" Copyright (c) 2012 Gary Mills
5 .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved
6 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text
8 .\" are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical
9 .\" and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
10 .\"  This notice shall appear on any product containing this material.
11 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
12 .\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
13 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
14 .TH CPIO 1 "Aug 3, 2009"
15 .SH NAME
16 cpio \- copy file archives in and out
17 .SH SYNOPSIS
18 .LP
19 .nf
20 \fBcpio\fR \fB-i\fR [\fB-bBcdfkmPqrsStuvV6@/\fR] [\fB-C\fR \fIbufsize\fR] [\fB-E\fR \fIfile\fR]
21      [\fB-H\fR \fIheader\fR] [\fB-I\fR \fI\fR [\fB-M\fR \fImessage\fR]] [\fB-R\fR \fIid\fR] [\fIpattern\fR]...
22 .fi
24 .LP
25 .nf
26 \fBcpio\fR \fB-o\fR [\fB-aABcLPqvV@/\fR] [\fB-C\fR \fIbufsize\fR] [\fB-H\fR \fIheader\fR]
27      [\fB-O\fR \fIfile\fR [\fB-M\fR \fImessage\fR]]
28 .fi
30 .LP
31 .nf
32 \fBcpio\fR \fB-p\fR [\fB-adlLmPquvV@/\fR] [\fB-R\fR \fIid\fR] \fIdirectory\fR
33 .fi
35 .SH DESCRIPTION
36 .sp
37 .LP
38 The \fBcpio\fR command copies files into and out of a \fBcpio\fR archive. The
39 \fBcpio\fR archive can span multiple volumes. The \fB-i\fR, \fB-o\fR, and
40 \fB-p\fR options select the action to be performed. The following list
41 describes each of the actions. These actions are mutually exclusive.
42 .SS "Copy In Mode"
43 .sp
44 .LP
45 \fBcpio\fR \fB-i\fR (copy in) extracts files from the standard input, which is
46 assumed to be the product of a previous \fBcpio\fR \fB-o\fR command. Only files
47 with names that match one of the \fIpattern\fRs are selected. See \fBsh\fR(1)
48 and OPERANDS for more information about \fIpattern\fR. Extracted files are
49 conditionally copied into the current directory tree, based on the options
50 described below. The permissions of the files are those of the previous \fBcpio
51 -o\fR command. The owner and group are the same as the current user, unless the
52 current user has the \fB{PRIV_FILE_CHOWN_SELF}\fR privilege. See
53 \fBchown\fR(2). If this is the case, owner and group are the same as those
54 resulting from the previous \fBcpio -o\fR command. Notice that if \fBcpio\fR
55 \fB-i\fR tries to create a file that already exists and the existing file is
56 the same age or younger (\fBnewer\fR), \fBcpio\fR outputs a warning message and
57 not replace the file. The \fB-u\fR option can be used to unconditionally
58 overwrite the existing file.
59 .SS "Copy Out Mode"
60 .sp
61 .LP
62 \fBcpio\fR \fB-o\fR (copy out) reads a list of file path names from the
63 standard input and copies those files to the standard output, together with
64 path name and status information in the form of a \fBcpio\fR archive. Output is
65 padded to an 8192-byte boundary by default or to the user-specified block size
66 (with the \fB-B\fR or \fB-C\fR options) or to some device-dependent block size
67 where necessary (as with the CTC tape).
68 .SS "Pass Mode"
69 .sp
70 .LP
71 \fBcpio\fR \fB-p\fR (pass) reads a list of file path names from the standard
72 input and conditionally copies those files into the destination directory tree,
73 based on the options described below.
74 .sp
75 .LP
76 If the underlying file system of the source file supports detection of holes as
77 reported by \fBpathconf\fR(2), the file is a sparse file, and the destination
78 file is seekable, then holes in sparse files are preserved in pass mode,
79 otherwise holes are filled with zeros.
80 .sp
81 .LP
82 \fBcpio\fR assumes four-byte words.
83 .sp
84 .LP
85 If, when writing to a character device (\fB-o\fR) or reading from a character
86 device (\fB-i\fR), \fBcpio\fR reaches the end of a medium (such as the end of a
87 diskette), and the \fB-O\fR and \fB-I\fR options are not used, \fBcpio\fR
88 prints the following message:
89 .sp
90 .in +2
91 .nf
92 To continue, type device/file name when ready.
93 .fi
94 .in -2
95 .sp
97 .sp
98 .LP
99 To continue, you must replace the medium and type the character special device
100 name (\fB/dev/rdiskette\fR for example) and press RETURN. You might want to
101 continue by directing \fBcpio\fR to use a different device. For example, if you
102 have two floppy drives you might want to switch between them so \fBcpio\fR can
103 proceed while you are changing the floppies. Press RETURN to cause the
104 \fBcpio\fR process to exit.
105 .SH OPTIONS
108 The following options are supported:
110 .ne 2
112 \fB\fB-i\fR\fR
114 .RS 6n
115 (copy in) Reads an archive from the standard input and conditionally extracts
116 the files contained in it and places them into the current directory tree.
120 .ne 2
122 \fB\fB-o\fR\fR
124 .RS 6n
125 (copy out) Reads a list of file path names from the standard input and copies
126 those files to the standard output in the form of a \fBcpio\fR archive.
130 .ne 2
132 \fB\fB-p\fR\fR
134 .RS 6n
135 (pass) Reads a list of file path names from the standard input and
136 conditionally copies those files into the destination directory tree.
141 The following options can be appended in any sequence to the \fB-i\fR,
142 \fB-o\fR, or \fB-p\fR options:
144 .ne 2
146 \fB\fB-a\fR\fR
148 .RS 14n
149 Resets access times of input files after they have been copied, making
150 \fBcpio\fR's access invisible. Access times are not reset for linked files when
151 \fBcpio\fR \fB-pla\fR is specified.
155 .ne 2
157 \fB\fB-A\fR\fR
159 .RS 14n
160 Appends files to an archive. The \fB-A\fR option requires the \fB-O\fR option.
161 Valid only with archives that are files, or that are on floppy diskettes or
162 hard disk partitions. The effect on files that are linked in the existing
163 portion of the archive is unpredictable.
167 .ne 2
169 \fB\fB-b\fR\fR
171 .RS 14n
172 Reverses the order of the bytes within each word. Use only with the \fB-i\fR
173 option.
177 .ne 2
179 \fB\fB-B\fR\fR
181 .RS 14n
182 Blocks input/output 5120 bytes to the record. The default buffer size is 8192
183 bytes when this and the \fB-C\fR options are not used. \fB-B\fR does not apply
184 to the \fB-p\fR (pass) option.
188 .ne 2
190 \fB\fB-c\fR\fR
192 .RS 14n
193 Reads or writes header information in \fBASCII\fR character form for
194 portability. There are no \fBUID\fR or \fBGID\fR restrictions associated with
195 this header format. Use this option between SVR4-based machines, or the
196 \fB-H\fR \fBodc\fR option between unknown machines. The \fB-c\fR option implies
197 the use of expanded device numbers, which are only supported on SVR4-based
198 systems. When transferring files between SunOS 4 or Interactive UNIX and the
199 Solaris 2.6 Operating environment or compatible versions, use \fB-H\fR
200 \fBodc\fR.
204 .ne 2
206 \fB\fB-C\fR \fIbufsize\fR\fR
208 .RS 14n
209 Blocks input/output \fIbufsize\fR bytes to the record, where \fIbufsize\fR is
210 replaced by a positive integer. The default buffer size is 8192 bytes when this
211 and \fB-B\fR options are not used. \fB-C\fR does not apply to the \fB-p\fR
212 (pass) option.
216 .ne 2
218 \fB\fB-d\fR\fR
220 .RS 14n
221 Creates directories as needed.
225 .ne 2
227 \fB\fB-E\fR \fIfile\fR\fR
229 .RS 14n
230 Specifies an input file (\fIfile\fR) that contains a list of filenames to be
231 extracted from the archive (one filename per line).
235 .ne 2
237 \fB\fB-f\fR\fR
239 .RS 14n
240 Copies in all files except those in \fIpattern\fRs. See OPERANDS for a
241 description of \fIpattern\fR.
245 .ne 2
247 \fB\fB-H\fR \fIheader\fR\fR
249 .RS 14n
250 Reads or writes header information in \fIheader\fR format. Always use this
251 option or the \fB-c\fR option when the origin and the destination machines are
252 different types. This option is mutually exclusive with options \fB-c\fR and
253 \fB-6\fR.
255 Valid values for \fIheader\fR are:
257 .ne 2
259 \fB\fBbar\fR\fR
261 .RS 17n
262 \fBbar\fR head and format. Used only with the \fB-i\fR option ( read only).
266 .ne 2
268 \fB\fBcrc\fR | \fBCRC\fR\fR
270 .RS 17n
271 \fBASCII\fR header with expanded device numbers and an additional per-file
272 checksum. There are no \fBUID\fR or \fBGID\fR restrictions associated with this
273 header format.
277 .ne 2
279 \fB\fBodc\fR\fR
281 .RS 17n
282 \fBASCII\fR header with small device numbers. This is the IEEE/P1003 Data
283 Interchange Standard cpio header and format. It has the widest range of
284 portability of any of the header formats. It is the official format for
285 transferring files between POSIX-conforming systems (see \fBstandards\fR(5)).
286 Use this format to communicate with SunOS 4 and Interactive UNIX. This header
287 format allows \fBUID\fRs and \fBGID\fRs up to 262143 to be stored in the
288 header.
292 .ne 2
294 \fB\fBtar\fR | \fBTAR\fR\fR
296 .RS 17n
297 \fBtar\fR header and format. This is an older \fBtar\fR header format that
298 allows \fBUID\fRs and \fBGID\fRs up to 2097151 to be stored in the header. It
299 is provided for the reading of legacy archives only, that is, in conjunction
300 with option \fB-i\fR.
302 Specifying this archive format with option \fB-o\fR has the same effect as
303 specifying the "ustar" format: the output archive is in \fBustar\fR format, and
304 must be read using \fB-H\fR \fBustar\fR.
308 .ne 2
310 \fB\fBustar\fR | \fBUSTAR\fR\fR
312 .RS 17n
313 IEEE/P1003 Data Interchange Standard tar header and format. This header format
314 allows \fBUID\fRs and \fBGID\fRs up to 2097151 to be stored in the header.
317 Files with \fBUID\fRs and \fBGID\fRs greater than the limit stated above are
318 archived with the \fBUID\fR and \fBGID\fR of \fB60001\fR. To transfer a large
319 file (8 Gb \(em 1 byte), the header format can be \fBtar|TAR\fR,
320 \fBustar|USTAR\fR, or \fBodc\fR only.
324 .ne 2
326 \fB\fB-I\fR \fIfile\fR\fR
328 .RS 14n
329 Reads the contents of \fIfile\fR as an input archive, instead of the standard
330 input. If \fIfile\fR is a character special device, and the current medium has
331 been completely read, replace the medium and press RETURN to continue to the
332 next medium. This option is used only with the \fB-i\fR option.
336 .ne 2
338 \fB\fB-k\fR\fR
340 .RS 14n
341 Attempts to skip corrupted file headers and I/O errors that might be
342 encountered. If you want to copy files from a medium that is corrupted or out
343 of sequence, this option lets you read only those files with good headers. For
344 \fBcpio\fR archives that contain other \fBcpio\fR archives, if an error is
345 encountered, \fBcpio\fR can terminate prematurely. \fBcpio\fR finds the next
346 good header, which can be one for a smaller archive, and terminate when the
347 smaller archive's trailer is encountered. Use only with the \fB-i\fR option.
351 .ne 2
353 \fB\fB-l\fR\fR
355 .RS 14n
356 In pass mode, makes hard links between the source and destination whenever
357 possible. If the \fB-L\fR option is also specified, the hard link is to the
358 file referred to by the symbolic link. Otherwise, the hard link is to the
359 symbolic link itself. Use only with the \fB-p\fR option.
363 .ne 2
365 \fB\fB-L\fR\fR
367 .RS 14n
368 Follows symbolic links. If a symbolic link to a directory is encountered,
369 archives the directory referred to by the link, using the name of the link.
370 Otherwise, archives the file referred to by the link, using the name of the
371 link.
375 .ne 2
377 \fB\fB-m\fR\fR
379 .RS 14n
380 Retains previous file modification time. This option is ineffective on
381 directories that are being copied.
385 .ne 2
387 \fB\fB-M\fR \fImessage\fR\fR
389 .RS 14n
390 Defines a \fImessage\fR to use when switching media. When you use the \fB-O\fR
391 or \fB-I\fR options and specify a character special device, you can use this
392 option to define the message that is printed when you reach the end of the
393 medium. One \fB%d\fR can be placed in \fImessage\fR to print the sequence
394 number of the next medium needed to continue.
398 .ne 2
400 \fB\fB-O\fR \fIfile\fR\fR
402 .RS 14n
403 Directs the output of \fBcpio\fR to \fIfile\fR, instead of the standard output.
404 If \fIfile\fR is a character special device and the current medium is full,
405 replace the medium and type a carriage return to continue to the next medium.
406 Use only with the \fB-o\fR option.
410 .ne 2
412 \fB\fB-P\fR\fR
414 .RS 14n
415 Preserves \fBACL\fRs. If the option is used for output, existing \fBACL\fRs are
416 written along with other attributes, except for extended attributes, to the
417 standard output. \fBACL\fRs are created as special files with a special file
418 type. If the option is used for input, existing \fBACL\fRs are extracted along
419 with other attributes from standard input. The option recognizes the special
420 file type. Notice that errors occurs if a \fBcpio\fR archive with \fBACL\fRs is
421 extracted by previous versions of \fBcpio\fR. This option should not be used
422 with the \fB-c\fR option, as \fBACL\fR support might not be present on all
423 systems, and hence is not portable. Use \fBASCII\fR headers for portability.
427 .ne 2
429 \fB\fB-q\fR\fR
431 .RS 14n
432 Quiet. Suppresses the number of blocks message that normally is printed
433 after the copy is completed.
437 .ne 2
439 \fB\fB-r\fR\fR
441 .RS 14n
442 Interactively renames files. If the user types a carriage return alone, the
443 file is skipped. If the user types a ``.'', the original pathname is retained.
444 Not available with \fBcpio\fR \fB-p\fR.
448 .ne 2
450 \fB\fB-R\fR \fIid\fR\fR
452 .RS 14n
453 Reassigns ownership and group information for each file to user ID. (ID must be
454 a valid login ID from the \fBpasswd\fR database.) This option is valid only
455 when id is the invoking user or the super-user. See \fBNOTES\fR.
459 .ne 2
461 \fB\fB-s\fR\fR
463 .RS 14n
464 Swaps bytes within each half word.
468 .ne 2
470 \fB\fB-S\fR\fR
472 .RS 14n
473 Swaps halfwords within each word.
477 .ne 2
479 \fB\fB-t\fR\fR
481 .RS 14n
482 Prints a table of contents of the input. If any file in the table of contents
483 has extended attributes, these are also listed. No files are created. \fB-t\fR
484 and \fB-V\fR are mutually exclusive.
488 .ne 2
490 \fB\fB-u\fR\fR
492 .RS 14n
493 Copies unconditionally. Normally, an older file is not replaced a newer file
494 with the same name, although an older directory updates a newer directory.
498 .ne 2
500 \fB\fB-v\fR\fR
502 .RS 14n
503 Verbose. Prints a list of file and extended attribute names. When used with the
504 \fB-t\fR option, the table of contents looks like the output of an \fBls\fR
505 \fB-l\fR command (see \fBls\fR(1)).
509 .ne 2
511 \fB\fB-V\fR\fR
513 .RS 14n
514 Special verbose. Prints a dot for each file read or written. Useful to assure
515 the user that \fBcpio\fR is working without printing out all file names.
519 .ne 2
521 \fB\fB-6\fR\fR
523 .RS 14n
524 Processes a UNIX System Sixth Edition archive format file. Use only with the
525 \fB-i\fR option. This option is mutually exclusive with \fB-c\fR and \fB-H\fR.
529 .ne 2
531 \fB\fB-@\fR\fR
533 .RS 14n
534 Includes extended attributes in archive. By default, \fBcpio\fR does not place
535 extended attributes in the archive. With this flag, \fBcpio\fR looks for
536 extended attributes on the files to be placed in the archive and add them, as
537 regular files, to the archive. The extended attribute files go in the archive
538 as special files with special file types. When the \fB-@\fR flag is used with
539 \fB-i\fR or \fB-p\fR, it instructs \fBcpio\fR to restore extended attribute
540 data along with the normal file data. Extended attribute files can only be
541 extracted from an archive as part of a normal file extract. Attempts to
542 explicitly extract attribute records are ignored.
546 .ne 2
548 \fB\fB-/\fR\fR
550 .RS 14n
551 Includes extended system attributes in archive. By default, \fBcpio\fR does not
552 place extended system attributes in the archive. With this flag, \fBcpio\fR
553 looks for extended system attributes on the files to be placed in the archive
554 and add them, as regular files, to the archive. The extended attribute files go
555 in the archive as special files with special file types. When the \fB-/\fR flag
556 is used with \fB-i\fR or \fB-p\fR, it instructs \fBcpio\fR to restore extended
557 system attribute data along with the normal file data. Extended system
558 attribute files can only be extracted from an archive as part of a normal file
559 extract. Attempts to explicitly extract attribute records are ignored.
562 .SH OPERANDS
565 The following operands are supported:
567 .ne 2
569 \fB\fIdirectory\fR\fR
571 .RS 13n
572 A path name of an existing directory to be used as the target of \fBcpio\fR
573 \fB-p\fR.
577 .ne 2
579 \fB\fIpattern\fR\fR
581 .RS 13n
582 Expressions making use of a pattern-matching notation similar to that used by
583 the shell (see \fBsh\fR(1)) for filename pattern matching, and similar to
584 regular expressions. The following metacharacters are defined:
586 .ne 2
588 \fB\fB*\fR\fR
590 .RS 9n
591 Matches any string, including the empty string.
595 .ne 2
597 \fB\fB?\fR\fR
599 .RS 9n
600 Matches any single character.
604 .ne 2
606 \fB\fB[...]\fR\fR
608 .RS 9n
609 Matches any one of the enclosed characters. A pair of characters separated by
610 `\(mi' matches any symbol between the pair (inclusive), as defined by the
611 system default collating sequence. If the first character following the opening
612 \fB`['\fR is a \fB`!'\fR, the results are unspecified.
616 .ne 2
618 \fB\fB!\fR\fR
620 .RS 9n
621 The ! (exclamation point) means \fInot\fR. For example, the \fB!abc*\fR pattern
622 would exclude all files that begin with \fBabc\fR.
625 In \fIpattern\fR, metacharacters \fB?\fR, \fB*\fR, and \fB[\fR\|.\|.\|.\fB]\fR
626 match the slash (\fB/\fR) character, and backslash (\fB\e\fR) is an escape
627 character. Multiple cases of \fIpattern\fR can be specified and if no
628 \fIpattern\fR is specified, the default for \fIpattern\fR is \fB*\fR (that is,
629 select all files).
631 Each pattern must be enclosed in double quotes. Otherwise, the name of a file
632 in the current directory might be used.
635 .SH USAGE
638 See \fBlargefile\fR(5) for the description of the behavior of \fBcpio\fR when
639 encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
640 .SH EXAMPLES
643 The following examples show three uses of \fBcpio\fR.
645 \fBExample 1 \fRUsing standard input
647 .in +2
649 example% \fBls | cpio -oc > ../newfile\fR
651 .in -2
656 When standard input is directed through a pipe to \fBcpio\fR \fB-o\fR, as in
657 the example above, it groups the files so they can be directed (>) to a single
658 file (\fB\&../newfile\fR). The \fB-c\fR option insures that the file is
659 portable to other machines (as would the \fB-H\fR option). Instead of
660 \fBls\fR(1), you could use \fBfind\fR(1), \fBecho\fR(1), \fBcat\fR(1), and so
661 on, to pipe a list of names to \fBcpio\fR. You could direct the output to a
662 device instead of a file.
665 \fBExample 2 \fRExtracting files into directories
667 .in +2
669 example% \fBcat newfile | cpio -icd "memo/a1" "memo/b*"\fR
671 .in -2
676 In this example, \fBcpio\fR \fB-i\fR uses the output file of \fBcpio\fR
677 \fB-o\fR (directed through a pipe with \fBcat\fR), extracts those files that
678 match the patterns (\fBmemo/a1\fR, \fBmemo/b*\fR), creates directories below
679 the current directory as needed (\fB-d\fR option), and places the files in the
680 appropriate directories. The \fB-c\fR option is used if the input file was
681 created with a portable header. If no patterns were given, all files from
682 \fBnewfile\fR would be placed in the directory.
685 \fBExample 3 \fRCopying or linking files to another directory
687 .in +2
689 example% \fBfind . -depth -print | cpio -pdlmv newdir\fR
691 .in -2
696 In this example, \fBcpio\fR \fB-p\fR takes the file names piped to it and
697 copies or links (\fB-l\fR option) those files to another directory,
698 \fBnewdir\fR. The \fB-d\fR option says to create directories as needed. The
699 \fB-m\fR option says to retain the modification time. (It is important to use
700 the \fB-depth\fR option of \fBfind\fR(1) to generate path names for \fBcpio\fR.
701 This eliminates problems that \fBcpio\fR could have trying to create files
702 under read-only directories.) The destination directory, \fBnewdir\fR, must
703 exist.
707 Notice that when you use \fBcpio\fR in conjunction with \fBfind\fR, if you use
708 the \fB-L\fR option with \fBcpio\fR, you must use the \fB-follow\fR option with
709 \fBfind\fR and vice versa. Otherwise, there are undesirable results.
712 For multi-reel archives, dismount the old volume, mount the new one, and
713 continue to the next tape by typing the name of the next device (probably the
714 same as the first reel). To stop, type a RETURN and \fBcpio\fR ends.
715 .SH ENVIRONMENT VARIABLES
718 See \fBenviron\fR(5) for descriptions of the following environment variables
719 that affect the execution of \fBcpio\fR: \fBLC_COLLATE\fR, \fBLC_CTYPE\fR,
720 \fBLC_MESSAGES\fR, \fBLC_TIME\fR, \fBTZ\fR, and \fBNLSPATH\fR.
722 .ne 2
724 \fB\fBTMPDIR\fR\fR
726 .RS 10n
727 \fBcpio\fR creates its temporary file in \fB/var/tmp\fR by default. Otherwise,
728 it uses the directory specified by \fBTMPDIR\fR.
731 .SH EXIT STATUS
734 The following exit values are returned:
736 .ne 2
738 \fB\fB0\fR\fR
740 .RS 6n
741 Successful completion.
745 .ne 2
747 \fB\fB>0\fR\fR
749 .RS 6n
750 An error occurred.
753 .SH ATTRIBUTES
756 See \fBattributes\fR(5) for descriptions of the following attributes:
761 box;
762 c | c
763 l | l .
764 ATTRIBUTE TYPE  ATTRIBUTE VALUE
766 CSI     Enabled
768 Interface Stability     Committed
771 .SH SEE ALSO
774 \fBar\fR(1), \fBcat\fR(1), \fBecho\fR(1), \fBfind\fR(1), \fBls\fR(1),
775 \fBpax\fR(1), \fBsetfacl\fR(1), \fBsh\fR(1), \fBtar\fR(1), \fBchown\fR(2),
776 \fBarchives.h\fR(3HEAD), \fBattributes\fR(5), \fBenviron\fR(5),
777 \fBfsattr\fR(5), \fBlargefile\fR(5), \fBstandards\fR(5)
778 .SH NOTES
781 The maximum path name length allowed in a \fBcpio\fR archive is determined by
782 the header type involved. The following table shows the proper value for each
783 supported archive header type.
788 c c c
789 l l l .
790 Header type     Command line options    Maximum path name length
791 BINARY  "\fB-o\fR"      256
792 POSIX   "\fB-oH\fR odc" 256
793 ASCII   "\fB-oc\fR"     1023
794 CRC     "\fB-oH\fR crc" 1023
795 USTAR   "\fB-oH\fR ustar"       255
800 When the command line options "\fB-o\fR \fB-H\fR \fBtar\fR" are specified, the
801 archive created is of type \fBUSTAR\fR. This means that it is an error to read
802 this same archive using the command line options "\fB-i\fR \fB-H\fR \fBtar\fR".
803 The archive should be read using the command line options "\fB-i\fR \fB-H\fR
804 \fBustar\fR". The options "\fB-i\fR \fB-H\fR \fBtar\fR" refer to an older tar
805 archive format.
808 An error message is output for files whose \fBUID\fR or \fBGID\fR are too large
809 to fit in the selected header format. Use \fB-H\fR \fBcrc\fR or \fB-c\fR to
810 create archives that allow all \fBUID\fR or \fBGID\fR values.
813 Only the super-user can copy special files.
816 Blocks are reported in 512-byte quantities.
819 If a file has \fB000\fR permissions, contains more than 0 characters of data,
820 and the user is not root, the file is not saved or restored.
823 When cpio is invoked in \fBCopy In\fR or \fBPass Mode\fR by a user with
824 \fB{PRIV_FILE_CHOWN_SELF}\fR privilege, and in particular on a system where
825 \fB{_POSIX_CHOWN_RESTRICTED}\fR is not in effect (effectively granting this
826 privilege to all users where not overridden), extracted or copied files can end
827 up with owners and groups determined by those of the original archived files,
828 which can differ from the invoking user's. This might not be what the user
829 intended. The \fB-R\fR option can be used to retain file ownership, if desired,
830 if you specify the user's id.
833 The inode number stored in the header (\fB/usr/include/archives.h\fR) is an
834 unsigned short, which is 2 bytes. This limits the range of inode numbers from
835 \fB0\fR to \fB65535\fR. Files which are hard linked must fall in this inode
836 range. This could be a problem when moving \fBcpio\fR archives between
837 different vendors' machines.
840 You must use the same blocking factor when you retrieve or copy files from the
841 tape to the hard disk as you did when you copied files from the hard disk to
842 the tape. Therefore, you must specify the \fB-B\fR or \fB-C\fR option.
845 During \fB-p\fR and \fB-o\fR processing, \fBcpio\fR buffers the file list
846 presented on stdin in a temporary file.
849 The new \fBpax\fR(1) format, with a command that supports it (for example,
850 \fBtar\fR), should be used for large files. The \fBcpio\fR command is no longer
851 part of the current POSIX standard and is deprecated in favor of \fBpax\fR.