How would you use the cpio command

cpio

While studying for the lpic exam, I've run into the command cpio.

The description of cpio states:

Cpio was originally designed to store backup file archives on a tape
device in a sequential, contiguous manner. Cpio does not compress any
content, but resulting archives are often compressed using gzip or
other external compressors.

In looking at examples of how to use cpio, I can't find a single scenario where cpio would better than more common tools like tar.

What is an example where using cpio would be used, (besides tape backups), or is it no longer relevant on todays systems?

Best Answer

It is still relevant for unpacking RPMs. There is a rpm2cpio utility that converts an RPM package to a cpio archive. As far as I know, there is nothing to convert an RPM to a tar archive. Here is an example usage:

rpm2cpio myrpmfile.rpm | cpio -idmv
Related Question