LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2004, 02:53 PM   #1
ksun
Member
 
Registered: Sep 2003
Posts: 52

Rep: Reputation: 15
using cpio


I have a file that I need to view what files are in it. I looked at the man pages for cpio, but I guess I just didn't "get it" because I keep getting errors.

If I have a file named "files.cpio.gz-i686" what can I do to open the archive and view the files (mount to a directory, list the files, whatever) and how do I extract the files and copy them to a directory?

I tried un-gzipping the file first, since it had gz in the name, but that didn't work.

Thanks in advance.
 
Old 12-13-2004, 02:55 PM   #2
drisay
Member
 
Registered: Sep 2004
Distribution: Slackware 10
Posts: 167

Rep: Reputation: 30
try:
gunzip files.cpio.gz-i686
then:
cpio -idmv < files.cpio
 
Old 12-13-2004, 02:56 PM   #3
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
gunzip is "broken" in that it won't try to extract a file with an 'unknown' suffix. do this:

Code:
mv files.cpio.gz-i686 files.cpio-i686.gz && gunzip files.cpio-i686.gz
That should extract the files.

EDIT:
At least the gzipped part. Post the error messages you get and we can help you better.

Last edited by visaris; 12-13-2004 at 02:57 PM.
 
Old 12-13-2004, 04:05 PM   #4
ksun
Member
 
Registered: Sep 2003
Posts: 52

Original Poster
Rep: Reputation: 15
I don't know why I didn't think of this.

I tried to gunzip the file without renaming it. The way most linux utils work, I almost can't believe you have to rename this file before you can gunzip.

anyway, gunzipping and then cpio worked.
 
Old 05-12-2006, 06:14 AM   #5
snehasis
LQ Newbie
 
Registered: May 2006
Posts: 1

Rep: Reputation: 0
for extracting cpio.gz files:

zcat /src/somefile.cpio.gz | cpio -idmv

would also do.
thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cpio error ntoughe AIX 9 12-31-2005 12:19 PM
How to use cpio to extract a cpio archive? linx win Debian 4 06-17-2005 02:53 PM
cpio problem mgventura Red Hat 0 04-15-2004 08:56 AM
cpio.gz?? unprocessed Linux - Newbie 7 09-11-2002 05:37 PM
Does CPIO compress? severedhead Linux - Software 1 08-03-2002 08:26 AM


All times are GMT -5. The time now is 02:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration