Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

User Commands (c) cpio(1)
cpio -i (Copy In)
This command reads an archive le created by the cpio -o command from the standard input le
and copies from it the les with names that match pattern. These les are copied into the current
directory tree. Permissions of the new les are the same as the permissions associated with the
les copied using cpio -o. The owner and group of the new les are those of the current user,
unless that user has appropriate privileges; if the user has appropriate privileges, cpio retains the
owner and group of the les copied using cpio -o. Only a user with appropriate privileges can
extract block special or character special les from an archive.
You can list more than one pattern operand using the lename notation described in the sh(1)
reference page. Note, however, that in the cpio command the special characters * (asterisk), ?
(question mark), and [](brackets) match the / (slash) in pathnames, in addition to their use as
described for the sh command. The default pattern is *, which selects all les in the archive. In
an expression such as [a-z], the dash means "through" according to the current collating
sequence. The collating sequence is determined by the LC_COLLATE environment variable.
cpio -p (Directory Copy)
This command reads le pathnames from the standard input le and copies these les into the
directory named by directory. The specied directory must already exist. If these pathnames
include directory names and if these directories do not already exist, you must use the -d ag to
cause the directories to be created.
Note that you can copy special les only if you have appropriate privileges. Pathnames cannot
exceed 128 bytes. Avoid giving cpio pathnames made up of many uniquely linked les, because
cpio might not have enough memory to keep track of them and could lose linking information.
Environment Variables
This command supports the use of the LANG, LC_ALL, LC_COLLATE, LC_CTYPE,
LC_MESSAGES, LC_TIME, NLSPATH, and TZ environment variables.
CAUTIONS
When redirecting the output from cpio to a special le (device), redirect it to the raw device and
not the block device. Because writing to a block device is done asynchronously, there is no way
to know whether the end of the device has been reached.
EXIT VALUES
The exit values for cpio are as follows:
0 (zero) The command executed successfully.
>0 An error occurred. If a le or directory cannot be created or overwritten, cpio
continues with the next le in the archive or the next le to be added to the
archive.
RELATED INFORMATION
Commands: ar(1), nd(1), ls(1), pax(1), sh(1).
Files: cpio(4), locale(4).
STANDARDS CONFORMANCE
This command conforms to the XPG4 Version 2 specication with extensions.
527188-004 Hewlett-Packard Company 273