Difference between 'pax', 'tar', and cpio


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Difference between 'pax', 'tar', and cpio
# 1  
Old 03-09-2011
Difference between 'pax', 'tar', and cpio

Could any one please help me in understanding the difference between pax,tar and cpio. all of them basically creates archive files.
# 2  
Old 03-09-2011
cpio is more advanced than tar, in a way that it can preserve file ownership, permissions and even timestamps. But it is also not so easy to use. I don't know much about pax. From what I remember it can convert between some archive formats or something Smilie
# 3  
Old 03-09-2011
Hi.

See http://en.wikipedia.org/wiki/List_of_archive_formats

Google, Wikipedia and man pages are your friends for factual information ... cheers, drl

Last edited by drl; 03-09-2011 at 11:12 AM..
# 4  
Old 03-09-2011
Quote:
Originally Posted by bartus11
cpio is more advanced than tar
cpio has many limitations and so does tar.
Quote:
in a way that it can preserve file ownership, permissions and even timestamps.
"tar" hopefully does that too.
# 5  
Old 03-09-2011
Quote:
Originally Posted by bartus11
cpio is more advanced than tar
The cpio utility is depreciated circa POSIX 2001 because it can't hold files >8GB.
Quote:
it can preserve file ownership, permissions and even timestamps.
So does any sensible UNIX archiver. tar does this by default. It was kept and extended to allow >8GB files while keeping backwards compatibiltiy with old tar: files < 8GB still use octal fields, but files >8GB use binary fields in such a way that archivers who don't understand those fields will ignore them.

The new pax format is in fact an extension of this extended tar, with a huge default blocksize and one optional extra field to carry filenames, group ID's, etc. that can't fit inside a normal tar's fields(groupid's > 07777777, etc.)

Last edited by Corona688; 03-09-2011 at 12:01 PM..
# 6  
Old 03-09-2011
Sorry guys, little brain freeze or something, I mixed "tar" with "cp" Smilie
# 7  
Old 03-09-2011
Standard "cpio", "tar" and "pax" have a 2Gb maximum size of any one file. There may be enhanced versions but don't assume cross-platform compatibility.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Cpio - input files (from list) are stored in different order inside cpio archive - why?

Due to budget constraints I have to reinvent an Enterprise backup system in a SPARC (sun4v) Solaris estate (10 & 11). (yep - reinvent wheel, fun but time consuming. Is this wise?! :confused: ) For each filesystem of interest, to try to capture a 'catalog' at the front of each cpio archive (for... (1 Reply)
Discussion started by: am115998
1 Replies

2. UNIX for Dummies Questions & Answers

Explain difference of tar command

Hello All, I have been seeing a weird(at least for me, at this point) issue with a specific tar command. 1st fashion) Normally, if i have to tar anything at the command line I tend to use tar -cvzf <tar-file_name.tgz> <directory_to_be_tarred> this command works perfectly fine with out... (1 Reply)
Discussion started by: getnetha
1 Replies

3. Shell Programming and Scripting

Help with tar/pax

Hi, I have tar ball "data.tar" which consists of many files from different directories. If I untar a file using following command, it will untar file to location /input/data tar -xvf data.tar /input/data/abc.txt I want the file to be untar in current directory and or any other... (3 Replies)
Discussion started by: pinnacle
3 Replies

4. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

5. UNIX for Dummies Questions & Answers

tar/cpio/pax read patterns from stdin

tar has the -T operand for reading patterns from a file. Is there any way to read patterns from stdin, without creating a temp file? I would like to avoid iterating over the archive repeatedly (e.g. with a loop or xargs) as this is a large archive and we're only extracting a small number of... (2 Replies)
Discussion started by: uiop44
2 Replies

6. Shell Programming and Scripting

pax me out

hi I am using this command pax -f /Unix/codes/code.tar -r -s::/Unix/archive: objective is to transfer tar file /Unix/codes/code.tar to /Unix/archive with untarring done . For this reason i am using pax and not tar -xvf as we cant specify untarred destination in that the problem is... (2 Replies)
Discussion started by: ultimatix
2 Replies

7. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

8. AIX

MKSYSB + tar / on same server: difference and useless ?

Hi again, we have several types of backups we do here. On the workstations backups that we do every 3 months, we do 2 backups on each ones: mksysb and a TAR /. I need to understand better what that mksysb does and figure out if doing both is useless where only one is enough I am looking at... (1 Reply)
Discussion started by: Browser_ice
1 Replies

9. UNIX for Advanced & Expert Users

pax help

we created a TAR file ( souce /opt/oracle/10.2) . If we want to extract it diff directory say (/tmp) . I know we can use pax to do this .but inside TAR we have absolute path ref . if we pax does it replaces absolute path in TAR ? Thanks (1 Reply)
Discussion started by: talashil
1 Replies

10. UNIX for Dummies Questions & Answers

Solaris and PAX

I am having trouble with the pax command on Saris. I want to sue it to untar a file to a different directory. So if mytar.tar conatins files that were in /u02/mydir/mydir2/mydir3, I want to untar them to /export/home/mydir. An example I have is: pax -r -s... (2 Replies)
Discussion started by: hshapiro
2 Replies
Login or Register to Ask a Question