Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


cpio | 4 comments | Create New Account
Click here to return to the 'cpio' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
cpio
Authored by: peyote on Jun 29, '02 11:35:25AM
Note:-


  • cpio (like most of the Unix-derived utils) is unaware of resource forks and HSFS+ metadata, so these won't be copied. It does have the advantage over some other Unix utils though in that it does the right thing with (eg) device nodes.

  • You need at least one argument (in this case -p) to say "read the list of filenames to copy from stdin".

  • A common idiom is "find . -print | cpio -pmduv /dest". Those arguments mean read files from stdin, reset the modification on the copied files, create new directories as needed, copy unconditionally (otherwise cpio will ignore a file if the destination exists and is newer) and be verbose.

  • Also useful is the 'l' flag, which instead of copying the files will create hard links (not symlinks) between the source and destination files if they are on the same filesystem (handy if you want multiple copies of a source tree, say to build for multiple architectures).


All in all, a very handy and powerful tool but not really for the faint hearted.

For people not 100% comfortable at the command line, if you just want to copy a directory tree then "cp -R" is going to be more useful 9 times out of 10.

Pete.

[ Reply to This | # ]
cpio
Authored by: exonic on Jun 29, '02 03:45:07PM

This is a unix command, part of the GNU fileutils I believe. man cpio should tell u exactly what it does. Yes, I agree it is a better way of copying file, especially when you are attempting to copy symbolic links, where as cp will just follow the links unless told otherwise via the command. For people who aren't comfortable w/ the console.. GET COMFORABLTE!!!!



[ Reply to This | # ]