cpio(1)

cpio(1)

NAME

cpio - copy ®le archives in and out; duplicate directory trees

SYNOPSIS

cpio -o [-e extarg ] [achvxABC]

cpio -i[bcdfmrstuvxBPRSU6] [pattern...]

cpio -p [-e extarg ] [adlmruvxU] directory

DESCRIPTION

The cpio command saves and restores archives of ®les on magnetic tape, other devices, or a regular ®le, and copies ®les from one directory to another while replicating the directory tree structure. When cpio completes processing the ®les, it reports the number of blocks written.

cpio

-o

(copy out, export)

Read standard input to obtain a list of path names, and copy those ®les to

 

 

standard output together with path name and status information. The output is padded to a

 

 

512-byte boundary.

cpio

-i

(copy in, import)

Extract ®les from standard input, which is assumed to be the result of a pre-

 

 

vious cpio -o.

 

If pattern..., is speci®ed, only the ®les with names that match a pattern according to the rules of Pattern Matching Notation (see regexp(5)) are selected. A leading ! on a pattern indicates that only those names that do not match the remainder of the pattern should be selected. Multiple patterns can be speci®ed. The patterns are additive. If no pattern is speci®ed, the default is * (select all ®les). See the f option, as well.

Extracted ®les are conditionally created and copied into the current directory tree, as determined by the options described below. The permissions of the ®les match the permissions of the original ®les when the archive was created by cpio -ounless the U option is used. File owner and group are that of the current user unless the user has appropriate privileges, in which case cpio retains the owner and group of the ®les of the previous cpio -o.

cpio -p(passthrough) Read standard input to obtain a list of path names of ®les which are then conditionally created and copied into the destination directory tree as determined by the options described below. directory must exist. Destination path names are interpreted relative to directory.

With the -poption, when handling a link, only the link is passed and no data blocks are actually read or written. This is especially noteworthy with cpio -pl, where it is very possible that all the ®les are created as links, such that no blocks are written and "0 blocks" is reported by cpio. (See below for a description of the -loption.)

Options

cpio recognizes the following options, which can be appended as appropriate to -i, -o, and -p. Whitespace and hyphens are not permitted between these options and -i, -o, or -p.

aReset access times of input ®les after they are copied.

bSwap both bytes and half-words. Use only with -i. See the P option for details; see also the s and S options.

cWrite or read header information in ASCII character form for portability.

dCreate directories as needed.

-eextarg

Speci®es the handling of any extent attributes of the ®le(s) to be archived or copied. extarg takes one of the following values.

warn Archive or copy the ®le and issue a warning message if extent attributes cannot be preserved.

ignore Do not issue a warning message even if extent attributes cannot be preserved. force Any ®le(s) with extent attributes will not be archived and a warning message

will be issued.

When using the -ooption, extent attributes are not preserved in the archive. Furthermore, the -poption will not preserve extent attributes if the ®les are being copied to a ®le system that does not support extent attributes. If -eis not speci®ed, the default value for extarg is

HP-UX Release 11i: December 2000

− 1 −

Section 1117

c