Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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? ;-)

share|improve this question
    
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

1 Answer 1

up vote 7 down vote accepted

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.

share|improve this answer
    
Also my first attempt. Failed to get cp to create symlink for source/some_deeper_dir/files. –  Jokester Apr 2 '13 at 16:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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