1

If I have a shared library called libAlpha.so, then in Ubuntu I can find its dependencies by running the command ldd libAlpha.

Is there a similar command in Ubuntu to find the dependencies of an executable?

manlio
  • 17,446
  • 14
  • 72
  • 116
Karnivaurus
  • 20,685
  • 51
  • 137
  • 232
  • 4
    `ldd` works for executables too – Kuba Jan 08 '15 at 12:25
  • 1
    Some executables *require* some plugins but load them at runtime using `dlopen` (so `ldd` won't show you that). You could also use `pmap` or `cat /proc/$(pidof executable)/maps` to understand the actually used shared libraries. – Basile Starynkevitch Jan 08 '15 at 12:28

2 Answers2

2

ldd should work for executables.

You can also try readelf -d (shows only direct dependencies).

Community
  • 1
  • 1
manlio
  • 17,446
  • 14
  • 72
  • 116
2

lddworks fine on executables too.

Just pass the path to the executable : ldd /bin/ls

dkg
  • 1,765
  • 14
  • 33