$linuxjunkies
>

ldd(1)

Print the shared object dependencies of ELF binaries and libraries.

UbuntuDebianFedoraArch

Synopsis

ldd [OPTION]... FILE...

Description

ldd prints the names and addresses of the shared libraries (dynamic dependencies) that a compiled binary or shared object requires to run. It reads the ELF header to identify required libraries and resolves them using the dynamic linker.

Use ldd to debug missing library errors, verify library versions, or understand what a binary depends on. It only works on ELF binaries; it will fail on shell scripts or static binaries.

Common options

FlagWhat it does
-vVerbose mode; print all symbol resolutions and version information
-uPrint unused direct dependencies (symbols not referenced by the binary)
-dPerform relocations and report missing symbols; do not execute the binary
-rPerform relocations for both needed objects and immediate symbols
--helpDisplay help message and exit

Examples

List all shared libraries required by the ls command

ldd /bin/ls

Verbosely list Python's dependencies with symbol resolution details

ldd -v /usr/bin/python3

Show unused direct library dependencies that myapp doesn't actually call

ldd -u /opt/myapp/binary

Find missing libraries without executing the binary

ldd -d ./a.out 2>&1 | grep 'not found'

Show only the C library dependency of bash

ldd /bin/bash | grep libc

Inspect the dynamic linker itself (lists its dependencies, if any)

ldd /lib64/ld-linux-x86-64.so.2

Related commands