I have a directory
~/tmp/foo/ that's populated with subdirectories, files, and symbolic links.
$ tree ~/tmp/foo/ tmp/foo/ ├── eggs │ ├── baz │ │ └── link3.txt -> /home/me/file3.txt │ └── link2.txt -> /home/me/file2.txt ├── hello.txt ├── link1.txt -> /home/me/file1.txt └── spam ├── link4.txt -> /home/me/file4.txt └── link5.txt -> /home/me/file5.txt 3 directories, 6 files
I want to recursively copy all the symbolic links under
~/tmp/foo/ as files (as if I'd used
cp -rH) to another (nonempty) directory
~/bar/. Is there a simple way to do this?
I've tried the following:
find ~/tmp/foo/ -type l -print | rsync -avzL --files-from=- ~/tmp/foo/ ~/tmp/bar/
But this fails.