I would like to make a copy of directory on a second hard drive. I want all of the links resolved and the actual files copied, even if I end up with duplicates under different subdirectories on the target media. I tried -- cp -R source dest but there are still links in dest. I don't see any options under man for cp that says to do what I'm trying to do. Will cp do this? If not, what other command can I use? Thanks, Greg Wallace
On Sun, 2005-09-04 at 18:13 -0800, Greg Wallace wrote:
I would like to make a copy of directory on a second hard drive. I want all of the links resolved and the actual files copied, even if I end up with duplicates under different subdirectories on the target media. I tried --
cp -R source dest
That's what the dereference (-L or --dereference) flag does. # cp -RL source dest That will follow the link (ie, copy the file and not the link). There is a similar flag for cpio (-L or --dereference). Bob
On Sunday, September 04, 2005 @ 6:22 PM, Bob Netherton wrote:
On Sun, 2005-09-04 at 18:13 -0800, Greg Wallace wrote:
I would like to make a copy of directory on a second hard drive. I want all of the links resolved and the actual files copied, even if I end up with duplicates under different subdirectories on the target media. I tried --
cp -R source dest
That's what the dereference (-L or --dereference) flag does.
# cp -RL source dest
That will follow the link (ie, copy the file and not the link). There is a similar flag for cpio (-L or --dereference).
Bob
Looks like that did the trick. "man" and "info" say -L Always follow symbolic links That doesn't really tell me that it will dereference them (or whatever the term is for what I wanted). But it sure looks like it did what I wanted. Thanks!! Greg Wallace
participants (2)
-
Bob Netherton
-
Greg Wallace