O'Reilly logo

Unix in a Nutshell, 4th Edition by Arnold Robbins

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

cpio

Synopsis

    cpio control_options [options]

Copy file archives in from, or out to, tape or disk, or to another location on the local machine. Each of the three control options, -i, -o, or -p accepts different options. (See also pax and tar.)

cpio -i [options] [patterns]
cpio --extract [options][patterns]

Copy in (extract) files whose names match selected patterns. Each pattern can include filename metacharacters from the Bourne shell. (Patterns should be quoted or escaped so that they are interpreted by cpio, not by the shell.) If no pattern is used, all files are copied in. During extraction, existing files are not overwritten by older versions in the archive (unless -u is specified).

cpio -o [options]
cpio --create [options]

Copy out a list of files whose names are given on the standard input.

cpio -p [options] directory
cpio --create [options] directory

Copy (pass) files to another directory on the same system. Destination pathnames are interpreted relative to the named directory.

Comparison of Valid Options

Options available to the -i, -o, and -p options are shown respectively in the first, second, and third row below. (The - is omitted for clarity.)

-i:   6   b B c C d E f   H I k   m M n r R s S t u v V z Z
    -o: 0 a A   B c C       F H     L   M O             v V z Z
    -p: 0 a           d           l L m   P   R       u v V

Common Options

-a, --reset-access-time

Reset access times of input files.

-A, --append

Append files to an archive (must use with -O or -F).

-b, --swap

Swap bytes and half-words to convert between big-endian and little-endian 32-bit integers. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required