Using cpio
Jump to navigation
Jump to search
Various notes on using the cpio command.
Create *.cpio archive
ls | cpio -ov -H tar -F sample.tar
Extract *.cpio archive
cpio -idv < /tmp/object.cpio
Create *.cpio archive with selected files
find . -iname *.c -print | cpio -ov >/tmp/c_files.cpio
Creating .tar files
The following will create .tar files using the cpio command:
ls | cpio -ov -H tar -F sample.tar
Extract .tar archive
cpio -idv -F sample.tar
View contents of .tar archive
cpio -it -F sample.tar
Create *.cpio archive with original files and symlinks
ls | cpio -oLv >/tmp/test.cpio
Preserve modification times while restoring *.cpio
ls | cpio -omv >/tmp/test.cpio
Directory copy
find . -depth | cpio -pmdv /mnt/out