Skip to Main Content
Unix in a Nutshell, 4th Edition
book

Unix in a Nutshell, 4th Edition

by Arnold Robbins
October 2005
Intermediate to advanced content levelIntermediate to advanced
908 pages
46h 42m
English
O'Reilly Media, Inc.
Content preview from Unix in a Nutshell, 4th Edition

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. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the Unix Operating System, 5th Edition

Learning the Unix Operating System, 5th Edition

John Strang, Grace Todino, Jerry Peek
UNIX and Linux System Administration Handbook, 5th Edition

UNIX and Linux System Administration Handbook, 5th Edition

Trent R. Hein, Evi Nemeth, Garth Snyder, Ben Whaley, Dan Mackin

Publisher Resources

ISBN: 0596100299Errata Page