Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to run a Unix program which runs for a few seconds, without sacrificing speed of execution. After it is done, I would like to know what dynamic (shared) libraries it used.

What is the appropriate command?

The main problem is that I have a handful of BLAS implementations, and I want to figure out exactly which one is being used by each of a handful of different programs.

share|improve this question
up vote 3 down vote accepted

Lastly, you could use strace. strace <program_to_execute will give you a ton of info, including calls to libraries. It's not nearly as clean as the other answers, but it's another way of doing things. (and useful in its own right)

--Christopher Karel

share|improve this answer

Using ldd you can see the dynamic libraries that are linked to a specific binary file.

Like so:

$ ldd /usr/bin/wget =>  (0x00007fffa5dff000) => /lib/ (0x00007f4d3280e000) => /lib/ (0x00007f4d3247e000) => /lib/ (0x00007f4d32279000) => /lib/ (0x00007f4d32071000) => /lib/ (0x00007f4d31cef000) => /lib/ (0x00007f4d31ad7000)
    /lib64/ (0x00007f4d32a73000) => /lib/ (0x00007f4d318ba000)
share|improve this answer

In addition to ldd, cat /proc/$pid/maps will show you which libraries have been mapped into memory, including dynamic ones loaded after program start (and deleted items too)

share|improve this answer
I should add, the program needs to be running -- you mention your runs are only a few seconds, you may need to suspend your program, or just be quick w/ the cat /proc/$pid/maps – Jason Jun 23 '10 at 2:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.