HP-UX Reference (11i v1 05/09) - 1 User Commands A-M (vol 1)

c
cpio(1) cpio(1)
Note that cpio archives created using a raw device file must be read using a raw device file.
When the end of the tape is reached,
cpio prompts the user for a new special file and continues.
If you want to pass one or more metacharacters to
cpio without the shell expanding them, be sure to pre-
cede each of them with a backslash (
\).
Device files written with the
-ox
option (such as /dev/tty03 ) do not transport to other implementa-
tions of
HP-UX.
EXTERNAL INFLUENCES
Environment Variables
LC_COLLATE determines the collating sequence used in evaluating pattern matching notation for file
name generation.
LC_CTYPE determines the interpretation of text as single and/or multi-byte characters, and the characters
matched by character class expressions in pattern matching notation.
LC_TIME determines the format and content of date and time strings output when listing the contents of
an archive with the v option.
LANG determines the language in which messages are displayed.
If LC_COLLATE, LC_CTYPE,orLC_TIME is not specified in the environment or is set to the empty
string, the value of LANG is used as a default for each unspecified or empty variable. If
LANG is not
specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of
LANG. If any interna-
tionalization variable contains an invalid setting,
cpio behaves as if all internationalization variables are
set to "C". See environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
cpio returns the following exit codes:
0 Successful completion. Review standard error for files that could not be transferred.
1 Error during resynchronization. Some files may not have been recovered.
2 Out-of-phase error. A file header is corrupt or in the wrong format.
DIAGNOSTICS
Out of phase--get help
Perhaps the "c" option should[n’t] be used
cpio -i
could not read the header of an archived file. The header is corrupt or it was written in a
different format. Without the R option, cpio returns an exit code of 2.
If no file name has been displayed yet, the problem may be the format. Try specifying a different
header format option: null for standard format;
c for ASCII; b, s, P,or
S, for one of the byte-
swapping formats; or
6 for UNIX Sixth Edition.
Otherwise, a header may be corrupt. Use the R option to have cpio attempt to resynchronize the
file automatically. Resynchronizing means that cpio
tries to find the next good header in the archive
file and continues processing from there. If
cpio tries to resynchronize from being out of phase, it
returns an exit code of 1.
Other diagnostic messages are self-explanatory.
EXAMPLES
Copy the contents of a directory into a tape archive:
ls | cpio -o > /dev/rmt/c0t0d0BEST
Duplicate a directory hierarchy:
cd olddir
find . -depth -print | cpio -pd
newdir
The trivial case
HP-UX 11i Version 1: September 2005 3 Hewlett-Packard Company Section 1119