Here is one way to do it.
Test for file:
cpio -itv -I <CPIO_FILE_NAME> *filetofind*
NOTE: The asterisks belong so you can find out how the file
is stored in the archive, leading slashes and all.
Restore:
cpio -idv -I <CPIO_FILE_NAME> *filetorestore*
you can also use cat and gzip:
cat <CPIO_ARCHIVE> | gunzip -c | cpio -itv *filestorestore*
If I made an error Dierk should be able to correct this :)
JLF Sends...
It seems like on Wed, Mar 01, 2000 at 11:01:36PM +0000, Wes Bateman scribbled:
Orig Msg> Hi all, I am trying to extract one specific file from a cpio archive.
Orig Msg> I usually just restore all directories and everything onto another
Orig Msg> machine and grab what files/directories I need. This time though, I
Orig Msg> have very little drive space available, so I want to only extract a
Orig Msg> single file.
Orig Msg>
Orig Msg> I've tried the -E option but I haven't had any luck, it still looks
Orig Msg> like it's extracting every file.
Orig Msg>
Orig Msg> Anyone have any ideas/suggestions?
Orig Msg>
Orig Msg> Thanks,
Orig Msg> Wes
Orig Msg>
The whole aim of practical politics is to keep the populace alarmed (and
hence clamorous to be led to safety) by menacing it with an endless series
of hobgoblins, all of them imaginary.
-- H.L. Mencken