It depends, if you are trying to find links to a specific file that is called foo.txt,
then this is the only good way:
find -L / -samefile path/to/foo.txt
On the other hand, if you are just trying to find links to any file that happens to be named foo.txt
, then something like
find / -lname foo.txt
or
find . -lname *foo.txt # ignore leading pathname components
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…