a short question: is it possible to list all symbolic links onto a directory other than running a find over the whole filesystem?

Background: I have a directory containing a lot of different versions of a library and I'd like to do some cleanup work and delete the versions which weren't used in any projects.

Thanks, Mathias

link|improve this question

feedback

3 Answers

up vote 4 down vote accepted

Unfortunately no. All information about a symlink is stored within the symlink itself, therefore it's impossible to find without scanning the entire filesystem.

link|improve this answer
Alright, thanks for the answer! – Mathias Apr 14 '10 at 17:50
feedback

You could something like this:

find /suspected/symlink/locations -type l -exec ls -l {} \; | grep ' SimlinkTargetDirectory'

link|improve this answer
Thanks, that was the method i knew, I just wanted to know if there's a simpler solution. – Mathias Apr 14 '10 at 21:42
feedback

ls -F will list everything but will give you a visual indication of what type the files are. Is that useful?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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