Wednesday, July 12, 2006

Copy everything from directory to another, with CPIO, preserving links

1) use mkdir to create the new directory where you want it.

2) cd into the directory you want to copy

3) Run this command.

find . -depth -print | cpio -pvdum /

4) This should copy everything from its current location to the new
directory while leaving all of the file permissions, ownership, and
links.

The key to this command is that you must be in the directory that you
want to copy. It basically copies all files and directories from your
current location on down to the new directory.

No comments: