SysIII/usr/src/man/man1/cpio.1
.TH CPIO 1
.SH NAME
cpio \- copy file archives in and out
.SH SYNOPSIS
.B cpio
.B \-o
[
.B acBv
]
.PP
.B cpio
.B \-i
[
.B Bcdmrtuv6
] [ patterns ]
.PP
.B cpio
.B \-p
[
.B adlmruv
] directory
.SH DESCRIPTION
.B 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.
.PP
.B Cpio \-i
(copy in)
extracts from the
standard input (which is assumed to be the product of a previous
.BR "cpio \-o" )
the names of files selected by
zero or more
.I patterns\^
given in the name-generating notation of
.IR sh (1).
In
.IR patterns ,
meta-characters
.BR ? ,
.BR \(** ,
and
.BR [ \|.\|.\|. ]
match the slash
.B /
character.
The default for
.I patterns\^
is
.BR \(**
(i.e., select all files).
.PP
.B Cpio \-p
(pass) copies
out and in
in a single operation.
Destination path names are interpreted relative to the named
.IR directory .
.PP
The meanings of the available options are:
.PP
.PD 0
.TP
.B a
Reset access times of input files after they have been copied.
.TP
.B B
Input/output is to be blocked 5,120 bytes to the record
(does not apply to the
.I pass\^
option; meaningful only with data directed to or from
.BR /dev/rmt? ).
.TP
.B d
.I Directories\^
are to be created as needed.
.TP
.B c
Write
.I header\^
information in
.SM ASCII
character form for portability.
.TP
.B r
Interactively
.I rename\^
files.
If the user types a null line, the
file is skipped.
.TP
.B t
Print a
.I table of contents\^
of the input.
No files are created.
.TP
.B u
Copy
.I unconditionally\^
(normally, an older file will not replace a newer file with the same name).
.TP
.B v
.IR Verbose :
causes a list of file
names to be printed.
When used with
the
.B t
option,
the table of contents looks like the output of an
.B ls\ \|\-l
command
(see
.IR ls (1)).
.TP
.B l
Whenever possible, link files rather than copying them.
Usable only with
the
.B \-p
option.
.TP
.B m
Retain previous file modification time.
This option is ineffective on directories that are being copied.
.TP
.B 6
Process an old (i.e.,
.SM UNIX
.I Sixth\^
Edition format)
file.
Only useful with
.B \-i
(copy in).
.PD
.SH EXAMPLES
The first example below copies the contents of a directory
into an archive;
the second duplicates a directory hierarchy:
.PP
.RS
ls \|\(bv \|cpio \|\-o \|>/dev/mt0
.PP
.PP
cd \|olddir
.br
find
.B \|.\|
\-print \|\(bv \|cpio \|\-pdl \|newdir
.RE
.PP
The trivial case
``find
.B \|.\|
\-print \|\(bv \|cpio \|\-oB \|>/dev/rmt0''
can be handled more efficiently by:
.PP
.RS
find
.B \|.\|
\-cpio \|/dev/rmt0
.RE
.SH SEE ALSO
ar(1), find(1), cpio(5).
.SH 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.