ENCORE1
UTERMINAL
TERMINAL
NEXT
$V1$
PAUSE
PAGETURNER
ENCORE5
ENCORE
BOX
COMMAND
GO
cpio
SYNTAX
cpio -o [acBv] - (copy out) from the
standard input onto an archive.
cpio -i [Bcdmrtuv] - (copy in) extracts
from the standard input (which normally is
redirected from an archive).
Note: If you use -d only, then directories are created
only as needed.
cpio -p [adlmruv] - (pass) copies out and in during
a single operation.
NOTE: Use the B option with raw/non-block
type devices only (/dev/rmt?)!
FUNCTION
cpio is an efficient archiving utility used
widely in software distribution and transfer.
cpio format offers more space efficiency
than tar format; however, the cpio
command is slightly more difficult to use
and does not handle directory hierarchies.
The cpio format is portable across all
UNIX-like systems.
When using cpio, it is important to
keep in mind the notion that this command
passes everything through the standard input;
therefore, it should always be used with
file redirection and UNIX pipes.
Let us look at some examples using cpio!
To copy the content of the current directory into
ls * | cpio -o > /dev/fd096ds15
ls * | cpio -o > /dev/rmt0
To duplicate a directory hierarchy to the
floppy drive /dev/rfd1 use:
find . -print | cpio -oB >/dev/rfd1
To extract the files from the archive on the
device /dev/rfdc0 and create the directories
as needed use:
cpio -iBcdv < /dev/rfdc0
Let us now try to use the cpio command.
The cpio command to archive all the files from
the directory /usr/cti to the floppy
drive /dev/fd0 is
$PROMPT$
That is correct!
You've got it on the 2nd try.
Good, you understand the concept.
Please type ls /usr/cti/* | cpio -o > /dev/fd0
Please type ls /usr/cti/* | cpio -o > /dev/fd0
I guess I must type this for you:
$PROMPT$
FORGET1
$PROMPT$ls /usr/cti/* | cpio -o > /dev/fd0
Observe the result on the terminal!
$PROMPT$
Let us now extract the files from the
archive on the device /dev/fd0
preserving the directory structure.
That is correct!
You've got it on the 2nd try.
Good, you understand the concept.
Please type cpio -id < /dev/fd0
Please type cpio -id < /dev/fd0
I will help you this time.
$PROMPT$
FORGET2
$PROMPT$cpio -id < /dev/fd0
If you had used the verbose flag v, you'd
see a list of files as they're being extracted.
$PROMPT$