O'Reilly logo

A Practical Guide to Linux® Commands, Editors, and Shell Programming, Third Edition by Mark G. Sobell

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

Options

A major option specifies the mode in which cpio operates: create, extract, or pass-through.

Major Options

You must include exactly one of these options. Options preceded by a double hyphen (––) work under Linux only. Options named with a single letter and preceded by a single hyphen work under Linux and OS X.

––extract  –i

(copy-in mode) Reads the archive from standard input and extracts files. Without a pattern-list, cpio extracts all files from the archive. With a pattern-list, cpio extracts only files with names that match one of the patterns in pattern-list. The following example extracts from the device mounted on /dev/sde1 only those files whose names end in .c:

$ cpio -i \*.c < /dev/sde1

The backslash prevents the shell from expanding ...

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