How To Use Cpio In Linux? – POFTUT

How To Use Cpio In Linux?

cpio is general file archiver used in Linux, Unix and BSD systems. It is created as a tape archive tool but gained new features along development. Cpio has its own compression format and extension.

Creating Archive With Cpio

We can create archive file with cpio by getting find output.

We use find to list all files in current working path and print all of them to the cpio to compress with its format.

We can create tar archive with cpio by specifying compression algorithm as tar.

  • -o is output file
  • -H tar specifies the compression algorithm will be tar

List Files Inside Cpio Archive

We can list files inside a cpio arhive

  • -F makes listing the files
List Files Inside Cpio Archive

List Files Inside Cpio Archive

Write Archive Into A Tape

We can write archive into a tape like below.

Extract Archive

Extracting is easy as archiving. We will use -i and -F option.

All files will be extracted to their original paths

Archive Into Remote System Tape

This is very useful and practical solution. Archiving can be done to the remote system tape file like below.

Track Operation With Verbose

Compression operation can be tracked by using verbose option which will give details about compression operation.

LEARN MORE  7z Command Tutorial With Examples To Compress And Extract Files In Linux

  • -v argument makes the command verbose

Supported Compression Algorithms and Formats

Leave a Reply

Your email address will not be published. Required fields are marked *

Enjoy this blog? Please spread the word :)