Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

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.

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

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

share|improve this answer
add comment

You could something like this:

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

share|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
add comment

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.