1832211 Members
2870 Online
110040 Solutions
New Discussion

Link

 
Benoît
Regular Advisor

Link

Hi,

Does anybody know how to find a symbolic link to point a specific file ?

Thanks.
4 REPLIES 4
Florian Heigl (new acc)
Honored Contributor

Re: Link

no direct way, as for a symbolic link You can't gather any data from it's target.

I'd go with a
find / -local -type s -exec ls -ld {} \; | grep $targetfile
with $targetfile being just the filename w/o path.

I hope this will work for You.
yesterday I stood at the edge. Today I'm one step ahead.
Pat Lieberg
Valued Contributor

Re: Link

You could use find:

find / -type l -name -print
Muthukumar_5
Honored Contributor

Re: Link

find / -type f -exec file -h {} \+ | grep '

hth.
Easy to suggest when don't know about the problem!
Muthukumar_5
Honored Contributor

Re: Link

You can also use specifically as,

find -type l -exec ls -l {} \+ | grep ''

or

find -type l -exec file -h {} \+ | grep 'symbolic link to '

hth.
Easy to suggest when don't know about the problem!