Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-25-2004, 08:57 PM   #1
LQ Newbie
Registered: Mar 2004
Distribution: Redhat and direct source
Posts: 27

Rep: Reputation: 15
cpio ... works like tar

Assume directories ../PAST and ../47 exists the following will create a tar
file that, yes, can be tar -xvf test.tar. cpio is just another way to create a tar
file file the "find" command.

find ../PAST/ | cpio -o --format=tar > test.tar
find ../PAST/ | cpio -o -H tar > test2.tar

Without the ">"

find ../PAST/ | cpio -o --format=tar -F test.tar
find ../PAST/ | cpio -o -H tar -F test2.tar

Using append

find ../PAST/ | cpio -o --format=tar -F test.tar
find ../47/ | cpio -o --format=tar --append -F test.tar

To list the contents

cpio -it < test.tar
cpio -it -F test.tar

To extract

cpio -i -F test.tar

Just passing a little info along...

Mike Chirico


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
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 11:55 AM
How to use cpio to extract a cpio archive? linx win Debian 4 06-17-2005 02:53 PM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 07:30 AM
tar or cpio - Which is better for tape backups? Br. Nicholas Linux - Software 2 07-02-2003 05:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:51 AM.

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