Linux ldd command

Updated: 05/04/2019 by Computer Hope
ldd command

On Unix-like operating systems, the ldd command prints shared library dependencies of programs and libraries.

This page covers the Linux version of ldd.

Description

ldd prints the shared libraries required by each program or shared library specified on the command line.

Syntax

ldd [OPTION]... FILE...

Options

--version Print the version number of ldd.
-v, --verbose Print all information, including (for example) symbol versioning information.
-d, --data-relocs Perform relocations and report any missing objects (ELF only).
-r, --function-relocs Perform relocations for both data objects and functions, and report any missing objects or functions (ELF only).
-u, --unused Print unused direct dependencies.
--help Display a help message and exit.

Examples

ldd /bin/bash

Displays the shared library dependencies of the program /bin/bash. Output resembles the following:

linux-vdso.so.1 =>  (0x00007fff6f3fe000)
libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f574c095000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f574be91000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f574bac7000)
/lib64/ld-linux-x86-64.so.2 (0x00007f574c2e4000)

ld — Link editor for object files.
pvs — Display the internal version information of dynamic objects within an ELF file.