Linux CPIO Command
Updated December 19, 2002
Created September 19, 2002


Autogenerated Site Map
Search this Site!:
Search this site powered by FreeFind


creating:
find mystuff/ | cpio -o > mystuff.cpio
find mystuff/ | cpio -o | gzip > mystuff.cgz
find mystuff/ | cpio -o | gzip > mystuff.cgz
find mystuff/ | cpio -o -H crc > modules.cpio
find mystuff/ | cpio -o -H crc | gzip > modules.cgz
unpacking:
cat mystuff.cpio | cpio -idvm
zcat mystuff.cgz | cpio -idvm
cat mystuff.cgz | gunzip | cpio -idvm

Note that .cgz is the same thing as .cpio.gz
Cpio "cpio's up" a bunch of files into one .cpio file
gzip is compression, but only works on one file, so the entire .cpio file is compressed.

Also when creating a tar or cpio backup, never, never, never use an "absolute" path -- you have been warned; also linux tar warns you of this too. The problem is that when you want to unpack, you cannot choose where to unpack to, you will be forced to unpack to the "same" absolute path. When creating a tar or cpio you should change the the appropriate directory and cpio from there.

Also when creating a tar or cpio it is general good practice to tar up a directory (appropriately named) which contains your files, rather than just the files. This is good courtesy to anyone unpacking your tarfile.

Also take note of the following commands:
gzip
gunzip
cat
zcat
bzcat
bzip2
bunzip2
zgrep
bzgrep


Search this Site!:
Search this site powered by FreeFind

Homepage: http://www.cpqlinux.com
Site Map: http://www.cpqlinux.com/sitemap.html