I just wondering myself if it would be possible to create massive amount of symbolic links using a for loop?
For exemple, I have a lot of directory on my /tmp directory (I know, not recommanded) and I do not want to move them out.
Instead I just want to have them on my root directory using symbolic links.
Here is what I did, but unfortunatly, do not work at all:
for directories in /tmp/; do ln -s /tmp/$directories /$directories; done
So if someone could bring me a hint, it would be wonderfull ;-) Thanks.
Try this.
Following block will create links as you explained.
If you want to filter out some names from /tmp ; use
-name
switch for find.If you want greater depth symlinked adjust/remove
-maxdepth
switchTo make these links you need write permissions on /
Ok, so, Job done thanks to everyone for your hints.
Here is my simple solution:
Et voila :D
Thank you, StackExchange community once again ;-)
You need to have write permissions to the directory where you want the symbolic link to be created. Bear in mind that /tmp is (usually) cleaned up at boot and may be cleaned periodically throughout the machine's uptime, so relying on things being around persistently in /tmp will bite you, sooner or later.