• 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. How to Remove/Delete All Packages from Channel(s) in SpaceWalk
  2. pulseaudio: command not found
  3. How to Find Filesystem Inode Utilization in Linux
  4. rpm-ostree Command Examples in Linux
  5. Downgrading an rpm package to a lower version (using “rpm” command)
  6. xrpd: command not found
  7. ltrace: command not found
  8. macchanger Command Examples in Linux
  9. killall: command not found
  10. autojump: Quickly jump among the directories you visit the most

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright