<s>
cpio	B-Application
is	O
a	O
general	O
file	B-Application
archiver	I-Application
utility	O
and	O
its	O
associated	O
file	O
format	O
.	O
</s>
<s>
It	O
is	O
primarily	O
installed	O
on	O
Unix-like	B-Operating_System
computer	O
operating	O
systems	O
.	O
</s>
<s>
The	O
software	B-Application
utility	I-Application
was	O
originally	O
intended	O
as	O
a	O
tape	O
archiving	O
program	O
as	O
part	O
of	O
the	O
Programmer	B-Operating_System
's	I-Operating_System
Workbench	I-Operating_System
(	O
PWB/UNIX	B-Operating_System
)	O
,	O
and	O
has	O
been	O
a	O
component	O
of	O
virtually	O
every	O
Unix	B-Application
operating	I-Application
system	I-Application
released	O
thereafter	O
.	O
</s>
<s>
All	O
variants	O
of	O
Unix	B-Application
also	O
support	O
other	O
backup	O
and	O
archiving	O
programs	O
,	O
such	O
as	O
tar	B-Application
,	O
which	O
has	O
become	O
more	O
widely	O
recognized	O
.	O
</s>
<s>
The	O
use	O
of	O
cpio	B-Application
by	O
the	O
RPM	B-Application
Package	I-Application
Manager	I-Application
,	O
in	O
the	O
initramfs	B-Application
program	O
of	O
Linux	B-Operating_System
kernel	I-Operating_System
2.6	I-Operating_System
,	O
and	O
in	O
Apple	O
's	O
Installer	O
(	O
pax	B-Device
)	O
make	O
cpio	B-Application
an	O
important	O
archiving	O
tool	O
.	O
</s>
<s>
Since	O
its	O
original	O
design	O
,	O
cpio	B-Application
and	O
its	O
archive	O
file	O
format	O
have	O
undergone	O
several	O
,	O
sometimes	O
incompatible	O
,	O
revisions	O
.	O
</s>
<s>
Most	O
notable	O
is	O
the	O
change	O
,	O
now	O
an	O
operational	O
option	O
,	O
from	O
the	O
use	O
of	O
a	O
binary	O
format	O
of	O
archive	O
file	O
meta	O
information	O
to	O
an	O
ASCII-based	O
representation	O
.	O
</s>
<s>
POSIX	O
abandoned	O
cpio	B-Application
command	B-Application
in	O
favor	O
of	O
pax	B-Device
command	B-Application
.	O
</s>
<s>
cpio	B-Application
appeared	O
in	O
Version	B-Operating_System
7	I-Operating_System
Unix	I-Operating_System
as	O
part	O
of	O
the	O
Programmer	B-Operating_System
's	I-Operating_System
Workbench	I-Operating_System
project	O
.	O
</s>
<s>
cpio	B-Application
was	O
originally	O
designed	O
to	O
store	O
backup	O
file	O
archives	O
on	O
a	O
tape	O
device	O
in	O
a	O
sequential	O
,	O
contiguous	O
manner	O
.	O
</s>
<s>
It	O
does	O
not	O
compress	O
any	O
content	O
,	O
but	O
resulting	O
archives	O
are	O
often	O
compressed	O
using	O
gzip	B-Application
or	O
other	O
external	O
compressors	O
.	O
</s>
<s>
When	O
creating	O
archives	O
during	O
the	O
copy-out	O
operation	O
,	O
initiated	O
with	O
the	O
command	B-Application
line	O
flag	O
,	O
cpio	B-Application
reads	O
file	O
and	O
directory	O
path	O
names	O
from	O
its	O
standard	O
input	O
channel	O
and	O
writes	O
the	O
resulting	O
archive	O
byte	O
stream	O
to	O
its	O
standard	O
output	O
.	O
</s>
<s>
Cpio	B-Application
is	O
therefore	O
typically	O
used	O
with	O
other	O
utilities	O
that	O
generate	O
the	O
list	O
of	O
files	O
to	O
be	O
archived	O
,	O
such	O
as	O
the	O
find	B-Application
program	O
.	O
</s>
<s>
The	O
resulting	O
cpio	B-Application
archive	O
is	O
a	O
sequence	O
of	O
files	O
and	O
directories	O
concatenated	O
into	O
a	O
single	O
archive	O
,	O
separated	O
by	O
header	O
sections	O
with	O
file	O
meta	O
information	O
,	O
such	O
as	O
filename	O
,	O
inode	O
number	O
,	O
ownership	O
,	O
permissions	O
,	O
and	O
timestamps	O
.	O
</s>
<s>
By	O
convention	O
,	O
the	O
file	O
name	O
of	O
an	O
archive	O
is	O
usually	O
given	O
the	O
file	O
extension	O
cpio	B-Application
.	O
</s>
<s>
This	O
example	O
uses	O
the	O
find	B-Application
utility	O
to	O
generate	O
a	O
list	O
of	O
path	O
names	O
starting	O
in	O
the	O
current	O
directory	O
to	O
create	O
an	O
archive	O
of	O
the	O
directory	O
tree	O
:	O
</s>
<s>
During	O
the	O
copy-in	O
operation	O
,	O
initiated	O
by	O
the	O
command	B-Application
line	O
flag	O
,	O
cpio	B-Application
reads	O
an	O
archive	O
from	O
its	O
standard	O
input	O
and	O
recreates	O
the	O
archived	O
files	O
in	O
the	O
operating	O
system	O
's	O
file	O
system	O
.	O
</s>
<s>
Command	B-Application
line	O
flag	O
tells	O
cpio	B-Application
to	O
construct	O
directories	O
as	O
necessary	O
.	O
</s>
<s>
Any	O
remaining	O
command	B-Application
line	O
arguments	O
other	O
than	O
the	O
option	O
flags	O
are	O
shell-like	O
globbing-patterns	O
;	O
only	O
files	O
in	O
the	O
archive	O
with	O
matching	O
names	O
are	O
copied	O
from	O
the	O
archive	O
.	O
</s>
<s>
The	O
following	O
example	O
extracts	O
the	O
file	O
/etc/fstab	B-Protocol
from	O
the	O
archive	O
:	O
</s>
<s>
The	O
files	O
contained	O
in	O
a	O
cpio	B-Application
archive	O
may	O
be	O
listed	O
with	O
this	O
invocation	O
:	O
</s>
<s>
List	O
may	O
be	O
useful	O
since	O
a	O
cpio	B-Application
archive	O
may	O
contain	O
absolute	O
rather	O
than	O
relative	O
paths	O
(	O
e.g.	O
,	O
/bin/ls	O
vs.	O
bin/ls	O
)	O
.	O
</s>
<s>
Cpio	B-Application
supports	O
a	O
third	O
type	O
of	O
operation	O
which	O
copies	B-Application
files	I-Application
.	O
</s>
<s>
In	O
this	O
mode	O
,	O
cpio	B-Application
reads	O
path	O
names	O
on	O
standard	O
input	O
like	O
the	O
copy-out	O
operation	O
,	O
but	O
instead	O
of	O
creating	O
an	O
archive	O
,	O
it	O
recreates	O
the	O
directories	O
and	O
files	O
at	O
a	O
different	O
location	O
in	O
the	O
file	O
system	O
,	O
as	O
specified	O
by	O
the	O
path	O
given	O
as	O
a	O
command	B-Application
line	O
argument	O
.	O
</s>
<s>
The	O
cpio	B-Application
utility	O
is	O
standardized	O
in	O
POSIX.1-1988	O
,	O
but	O
was	O
omitted	O
from	O
POSIX.1-2001	O
because	O
of	O
its	O
file	O
size	O
and	O
other	O
limitations	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
GNU	B-Operating_System
version	O
offers	O
various	O
output	O
format	O
options	O
,	O
such	O
as	O
"	O
bin	O
"	O
(	O
default	O
,	O
and	O
obsolete	O
)	O
and	O
"	O
ustar	O
"	O
(	O
POSIX	O
tar	B-Application
)	O
,	O
having	O
a	O
file	O
size	O
limitations	O
of	O
2,147,483,647	O
bytes	O
(	O
2	O
GB	O
)	O
and	O
8,589,934,591	O
bytes	O
(	O
8	O
GB	O
)	O
,	O
respectively	O
.	O
</s>
<s>
The	O
cpio	B-Application
,	O
ustar	O
,	O
and	O
pax	B-Device
file	O
formats	O
are	O
defined	O
by	O
POSIX.1-2001	O
for	O
the	O
pax	B-Device
utility	O
,	O
which	O
is	O
currently	O
POSIX	O
1003.1-2008	O
compliant	O
,	O
and	O
so	O
it	O
can	O
read	O
and	O
write	O
cpio	B-Application
and	O
ustar	O
formatted	O
archives	O
.	O
</s>
<s>
Most	O
Linux	B-Application
distributions	I-Application
provide	O
the	O
GNU	B-Operating_System
version	O
of	O
cpio	B-Application
.	O
</s>
<s>
FreeBSD	B-Operating_System
and	O
macOS	B-Application
use	O
the	O
BSD-licensed	O
bsdcpio	O
provided	O
with	O
libarchive	O
.	O
</s>
