Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which all processes are using shared library

Tags:

unix

I have a shared library(.so file) on UNIX. I need to know what all running processes are using it. Do unix provide any such utility/command?

like image 905
Pradeep Avatar asked May 27 '26 00:05

Pradeep


1 Answers

You can inspect the contents of /proc/<pid>/maps to see which files are mapped into each process. You'll have to inspect every process, but that's easier than it sounds:

$ grep -l /lib/libnss_files-2.11.1.so /proc/*/maps
/proc/15620/maps
/proc/22439/maps
/proc/22682/maps
/proc/32057/maps

This only works on the Linux /proc filesystem, AFAIK.

like image 138
Marcelo Cantos Avatar answered May 30 '26 05:05

Marcelo Cantos



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!