User Tools

Site Tools


ldd is a useful command that allows you to view the shared libraries that an executable actually uses. For instance as a simple exercise you can view the shared libraries that 'ls' uses:

tweedleburg:~ # ldd /bin/ls => /lib64/ (0x00002b10e2667000) => /lib64/ (0x00002b10e2870000) => /lib64/ (0x00002b10e2a77000) => /lib64/ (0x00002b10e2dbd000)
        /lib64/ (0x00002b10e244a000) => /lib64/ (0x00002b10e2fd8000)

The real use for this command is when an executable is failing because of a missing dependency.

tweedleburg:~ # ldd /bin/ls | [[grep]] "not found"

When ldd is run it will display what the executable is Trying to load, but failing to find. Often paths are set up wrongly on other flavours of unix, or ldconfig needs to be run to update the cache for the dynamic linker

If you want to get a list of files that are needed by your executables, read RegExP and use:

[[ldd]] /home/kde-devel/kde/bin/ktimetracker [[piping||]] [[sed]] "s;.*=> \(/[^S]*\).*;\1;" | sed "s;\(.*\) (.*;\1;" | [[uniq]]

See also

ldd.txt · Last modified: 2016/10/22 19:36 by Mike J. Kreuzer PhD MCSE MCT Microsoft Cloud Ecosystem