I've received a Unix software distribution as a compressed cpio file. What's the best command to extract the files?

link|improve this question

75% accept rate
When you did man cpio what did you see? – S.Lott Aug 28 '09 at 0:56
I see: -i -o -p -t -B -c -C -f -F -H -M -n -v -V -W -b -r -s -S -E -A -O -l -0 -a -I -L -R -d -m -u -? --extract --create --pass-through --list --block-size= --io-size= --force-local --nonmatching --file= --format= --message= --numeric-uid-gid --quiet --rsh-command= --verbose --dot --warning= --swap --rename --swap-bytes --swap-halfwords --to-stdout --pattern-file= --only-verify-crc --append --link --absolute-filenames --no-absolute-filenames --null --reset-access-time --dereference --owner= --make-directories --preserve-modification-time --no-preserve-owner --sparse --unconditional – Mark Harrison Aug 28 '09 at 1:01
feedback

migrated from stackoverflow.com Aug 28 '09 at 1:28

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 4 down vote accepted
gzip -cd foo.cpio.gz | cpio -idmv
  • i : extract (input)
  • d : create directories
  • m : preserve mtime
  • v : verbose
link|improve this answer
feedback

This Wikipedia page on cpio has some good notes.
For more details, refer to the cpio manual.

A link from the same Wikipedia page discusses comparison with tar archives.
And, here is an example of using cpio with the tar format.

link|improve this answer
feedback

take a look here

CPIO HOW-TO

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.