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'm awared that find -L or find -type l would find all symbolic links on a given path.

But I'm trying to find all symbolic links that points to my foo folder.

Any tips?

share|improve this question
    
Except that's how it's done. –  Ignacio Vazquez-Abrams Aug 3 '11 at 0:07
    
@Ignacio Sorry, changed the point of question. Could you re-read? –  Gabriel L. Oliveira Aug 3 '11 at 0:13

1 Answer 1

I found how to do that.

find / -lname /path/to/foo/folder

Will give me every symlink pointing to that folder.

Although find mess up with /proc folder, but that's life.

EDIT: Also, it's also possible to:

Find the inode number of the file and then search for all files with the same inode number:

$ ls -i foo.txt
41525360 foo.txt

$ find . -follow -inum 41525360
Alternatively, try the lname option of find, but this won't work if you have relative symlinks e.g. a -> ../foo.txt

$ find . -lname /path/to/foo.txt

ps: took from this question

share|improve this answer

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.