Using cpio to extract/create archives in Linux
Commands to create or extract cpio files in Linux.
To create a cpio archive from a list of files:
[bash]ls | cpio -ov > nameOfArchive.cpio[/bash]
usage:
[bash]ls #to list the files to pack
| #pipe to cpio
o #create pack
v #list the files
> #pack to name-of-archive[/bash]
To extract a cpio archive to a destination dir:
[bash]cpio -idv < nameOfArchive.cpio[/bash]
usage:
[bash]i #extract
d #create dirs
v #show status
< #extract from pack to current dir[/bash]
Comments