19

I am seeking for a command that would re-create a whole tree of files in a different directory. I would prefer to have all symlinks absolute. Can I do that with a find and xargs? ;-)

  • 1
    I don't get the idea. If you make, for example, a symlink named /tmp/somedirectory pointing at /home/me/somegreatdir, then all the contents of somegreatdir will be visible under /tmp/somedirectory. This needs just one symlink for the entire tree. Or what else do you want? – jankes Nov 12 '11 at 23:41
23

cp -rs source/ dest/ should do the trick. The directory structure will be recreated at dest/ with each file being a symlink to its counterpart in source.

1

In case cp -rs is not the answer you're looking for, lndir might be the correct answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.