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?
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?
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