• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

ldd Command Options in Linux

by admin

You can see what shared libraries a specific command uses by using the ldd command. Here is the syntax of the ldd command:

# ldd [options] FILE

For example:

# ldd /bin/cp
 linux-vdso.so.1 => (0x00007ffc35df9000)
 libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f93faa09000)
 libacl.so.1 => /lib64/libacl.so.1 (0x00007f93fa800000) 
 libattr.so.1 => /lib64/libattr.so.1 (0x00007f93fa5fa000)
 libc.so.6 => /lib64/libc.so.6 (0x00007f93fa239000) 
 libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f93f9fd8000) 
 liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f93f9db2000) 
 libdl.so.2 => /lib64/libdl.so.2 (0x00007f93f9bae000) 
 /lib64/ld-linux-x86-64.so.2 (0x00007f93fac42000) 
 libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f93f9992000)

The purpose of using the ldd command is to troubleshoot problems with code that you are writing. This command tells you not only what libraries are being called, but specifically which directory each library is being called from. This can be extremely useful when a library is not behaving as you would expect it to behave.

ldd Command Options

Option Description
–version Print the version number ofldd.
-v,–verbose Print all information, including, for example, symbol versioning information.
-u,–unused Print unused direct dependencies. (Since glibc 2.3.4.)
-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).
–help Usage information.

Filed Under: CentOS/RHEL, Fedora, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 6 : Install and Configure SNMPv3
  2. How to recover GRUB (Corrupted boot partition) in CentOS/RHEL 5,6
  3. featureCounts: command not found
  4. How to Create/Format/Extend Virtual Data Optimizer(VDO) Volumes using Cockpit Web Console in CentOS/RHEL 8
  5. Linux OS Service ‘sshd’
  6. Manage ASM Audit Files with syslog – configure lograte and auditing
  7. CentOS / RHEL 7 : How to configure Network Bonding or NIC teaming
  8. join Command Examples in Linux
  9. CentOS / RHEL 7 : How to recover from deleted root entry in /etc/shadow and/or /etc/passwd files
  10. CentOS / RHEL : How to disable ssh for non-root users (allowing ssh only for root user)

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright