Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine which executables link to a specific shared library on Linux

How can I list all executables on my Red Hat Linux system which link to libssl? I can get close with:

find / -type f -perm /a+x -exec ldd {} \; | grep libssl   

ldd shows me which libraries the executable links with, but the line that contains the library name does not also show the filename, so although I get a lot of matches with grep, I can't figure out how to back out the name of the executable from which the match occured. Any help would be greatly appreciated.

like image 507
Steven Avatar asked Nov 25 '25 17:11

Steven


2 Answers

find / -type f -perm /a+x -print0 |
    while read -d $'\0' FILE; do
        ldd "$FILE" | grep -q libssl && echo "$FILE"
    done
like image 176
John Kugelman Avatar answered Nov 28 '25 07:11

John Kugelman


I'm not sure, but maybe sudo lsof |grep libssl.so

like image 22
a1ex07 Avatar answered Nov 28 '25 06:11

a1ex07



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!