Linux – How to see the currently loaded shared objects in Linux

librarieslinux

I have two, related questions:

  • How can I see if a shared library is currently loaded? (i.e. system-wide, process agnostic)
  • How can I see all shared libraries loaded by a process?

Best Answer

You can do both with lsof. To see what processes have a library open or mapped do:

lsof /path/to/lib.so

and to see what files (including shared libraries) a process has open and/or mapped, do:

lsof -p <pid>