Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .