Unix Archive Tools

Posted by Fred C (W6BSD) on Aug 13 2015

The cpio(1) name is derived from CoPy In and Out. Cpio was standardized in POSIX.1-1988, but it was omitted from POSIX.1-2001 because of its file size and other limitations. The use of cpio by the RPM Package Manager make cpio an important archiving tool.

The archive tool pax(1) is the POSIX standard archive tool. It supports the two most common forms of standard archive files: cpio and tar. The command invocation is a unification of tar and cpio

The name tar(1) is derived from Tape ARchive, it was originally to write data to sequential I/O devices. The tar file structure was standardized in POSIX.1-19881 and later POSIX.1-2001.2 and became a format supported by most modern file archiving systems.

List the content of an archive:

$ cpio -i -t < archive.cpio
$ pax < archive.tar
$ tar -tvf archive.tar

Extract files from an archive:

$ cpio -i -v -d < archive.cpio
$ pax -rv < archive.tar
$ tar -xvf archive.tar

Create an archive:

$ find dir file1 file2 -print | cpio -ov > archive.cpio
$ pax -wvf archive.tar dir file1 file2
$ tar -cvf archive.tar dir file1 file2

 Unix      Sys Admin