CPIO(1)
NAME
cpio − copy file archives in and out
SYNOPSIS
cpio −o [ acBv ]
cpio −i [ Bcdmrtuv6 ] [ patterns ]
cpio −p [ adlmruv ] directory
DESCRIPTION
Cpio −o (copy out) reads the standard input to obtain a list of path names and copies those files onto the standard output together with path name and status information.
Cpio −i (copy in) extracts from the standard input (which is assumed to be the product of a previous cpio −o) the names of files selected by zero or more patterns given in the name-generating notation of sh(1). In patterns, meta-characters ?, ∗, and [...] match the slash / character. The default for patterns is ∗ (i.e., select all files).
Cpio −p (pass) copies out and in in a single operation. Destination path names are interpreted relative to the named directory.
The meanings of the available options are:
a Reset access times of input files after they have been copied.
B Input/output is to be blocked 5,120 bytes to the record (does not apply to the pass option; meaningful only with data directed to or from /dev/rmt?).
d Directories are to be created as needed.
c Write header information in ASCII character form for portability.
r Interactively rename files. If the user types a null line, the file is skipped.
t Print a table of contents of the input. No files are created.
u Copy unconditionally (normally, an older file will not replace a newer file with the same name).
v Verbose: causes a list of file names to be printed. When used with the t option, the table of contents looks like the output of an ls −l command (see ls(1)).
l Whenever possible, link files rather than copying them. Usable only with the −p option.
m Retain previous file modification time. This option is ineffective on directories that are being copied.
6 Process an old (i.e., UNIX Sixth Edition format) file. Only useful with −i (copy in).
EXAMPLES
The first example below copies the contents of a directory into an archive; the second duplicates a directory hierarchy:
ls │ cpio −o >/dev/mt0
cd olddir
find . −print │ cpio −pdl newdir
The trivial case “find . −print │ cpio −oB >/dev/rmt0” can be handled more efficiently by:
find . −cpio /dev/rmt0
SEE ALSO
BUGS
Path names are restricted to 128 characters. If there are too many unique linked files, the program runs out of memory to keep track of them and, thereafter, linking information is lost. Only the super-user can copy special files.