Take the 2-minute tour ×

I remember that there is an utility for GNU/Linux, that given some directory, builds the same directory hierarchy, but with all regular files replaced by symlinks to the corresponding ones.

I can't remember its name.

Yes, I know it's a simple lesson in shell programming, but no reason to reinvent the wheel.

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

cp has a -s flag, which makes symlinks, instead of copying. You can probably combine it with -r, so it recursively links everything, eg.:

cp -rs ./folder ./target/
share|improve this answer
Perfect. Thank you very much. –  KAction Apr 2 '12 at 4:23
add comment

How about some command-line fu? There are a number of ideas on that page.

share|improve this answer
add comment

Your Answer


