Next: , Previous: , Up: Invoking cpio   [Contents][Index]

3.2 Copy-in mode

In copy-in mode, cpio copies files from an archive into the filesystem or lists the archive contents. It reads the archive from the standard input. Any non-option command line arguments are shell globbing patterns; only files in the archive whose names match one or more of those patterns are copied from the archive. Unlike in the shell, an initial ‘.’ in a filename does match a wildcard at the start of a pattern, and a ‘/’ in a filename can match wildcards. If no patterns are given, all files are extracted.

The copy-in mode is requested by the -i (--extract) command line option.

The following options can be used in copy-in mode:


Do not strip file system prefix components from the file names.


Create all files relative to the current directory.


Sets the I/O block size to block-size * 512 bytes.


Swap both halfwords of words and bytes of halfwords in the data. Equivalent to -sS.


Set the I/O block size to 5120 bytes.


Use the old portable (ASCII) archive format.

-C number

Set the I/O block size to the given number of bytes.

-D dir

Change to directory dir


Create leading directories where needed.

-E file

Read additional patterns specifying filenames to extract or list from file.


Only copy files that do not match any of the given patterns.


Treat the archive file as local, even if its name contains colons.

-F [[user@]host:]archive-file
-I [[user@]host:]archive-file

Use the supplied archive-file instead of standard input. Optional user and host specify the user and host names in case of a remote archive.

-H format

Use given archive format. See format, for a list of available formats.


Retain previous file modification times when creating files.

-M string

Print string when the end of a volume of the backup media is reached.


Do not change the ownership of the files.


In the verbose table of contents listing, show numeric UID and GID values.


When reading a CRC format archive, only verify the CRC’s of each file in the archive, don’t actually extract the files


Do not print the number of blocks copied.


Use command instead of rsh to access remote archives.


Interactively rename files


Write files with large blocks of zeros as sparse files.


Swap the bytes of each halfword in the files


Swap the halfwords of each word (4 bytes) in the files


Extract files to standard output.


Replace all files unconditionally.


Verbosely list the files processed.


Print a ‘.’ for each file processed.


Control warning display. Argument is one of ‘none’, ‘truncate’, ‘no-truncate’ or ‘all’. See warning, for a detailed discussion of these.

Next: , Previous: , Up: Invoking cpio   [Contents][Index]