Operating System - HP-UX
1822040 Members
3549 Online
109640 Solutions
New Discussion юеВ

Re: what do i do with a .cpio file

 
Donald Thaler
Super Advisor

what do i do with a .cpio file

I had a .cpio.gz file which i unzipped and it created a .tar file and a .cpio file. I know what to do with the .tar file, but what is the .cpio file. I thought I could do a cpio -t filename to print the table of contents but it didn't like the -t option???
10 REPLIES 10
Ivan Ferreira
Honored Contributor

Re: what do i do with a .cpio file

Use something like this to extract the file:

cpio -idv < cpio_file
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
pabel
Valued Contributor

Re: what do i do with a .cpio file

Hi Donald, you can extract cpio files in your current path using:

cpio -idmv < file

Where file is your .cpio file. To list file contents the sintaxis is:

cpio -t < file

Regards,
pabel
Ninad_1
Honored Contributor

Re: what do i do with a .cpio file

Hi Donald,

Please use
cpio -itv < filename.cpio
to list the contents

Regards,
ninad
Peter Nikitka
Honored Contributor

Re: what do i do with a .cpio file

Hi,

to get the content info of a cpio-archive use

cpio -itv
More info is found in 'man cpio'.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Ivan Ferreira
Honored Contributor

Re: what do i do with a .cpio file

If you want to list the content of the file first, use:

cpio -it < file.cpio
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Donald Thaler
Super Advisor

Re: what do i do with a .cpio file

When i do the cpio -itv i get the following error 'su: HPUNIX_GridControl_agent_download_10_2_0_1.cpio: Cannot find or open the file'

If i leave the '<' out nothing happens..

I'm positioned in the directory that has the .cpio file...

I'm logged in as the owner of the directory that has the .cpio file..
Peter Nikitka
Honored Contributor

Re: what do i do with a .cpio file

Hi,

please send the outout of
ls -l *.cpio

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Ninad_1
Honored Contributor

Re: what do i do with a .cpio file

Donald,

Also do a
file filename.cpio
to check its showing a cpio archive.

Regards,
Ninad
Stephen Keane
Honored Contributor

Re: what do i do with a .cpio file

Why is there an "su:" in your error message?
Steve Post
Trusted Contributor

Re: what do i do with a .cpio file

The first thing you should do is "man cpio".

The second thing is perhaps you need a "./" in front of the filename.
I.e.
cpio -itdumvc < ./HP_text_text.cpio

To make a cpio file
find . -print | cpio -odumvc > ./file.cpio

To read file LISTING from a cpio file.
cpio -itdumvc < ./file.cpio

To extract all stuff from a cpio file.
cpio -idumvc < ./file.cpio

c - Character format
B - block format
Bc - a little of both?
I just try cpio with and without c and B.
If you get an "out-of-phase" error, you are using the wrong option.
What do I mean?
try cpio -itdumvc < ./file
and cpio -itdumvB < ./file
and cpio -itdumvBc < ./file
and cpio -itdum < ./file

t - means list the stuff, don't extract it.
d - means make directories
u - means do it no matter what
m - means retain owner and modification time.
i - means read a file
o - means make a file