Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If I have a program named program, is there a way to know which dynamic libraries it loads and uses?

It's a simple question. I can elaborate more if needed, but I'll keep the question simple based on Tomas's suggestion.

share|improve this question
1  
Could downvoter please explain? I understand it's not a very complex problem, but if that upsets you... sorry. –  Cornstalks Jul 16 '13 at 21:11
    
I didn't downvote, but maybe your question sounds little confusing. The 1st paragraph is there only for confusion, the question started to be clear when I read the 2nd. Maybe just delete the 1st and it will be fine :) –  Tomas Jul 16 '13 at 21:18
    
@Tomas: Will do, thanks for the feedback! –  Cornstalks Jul 16 '13 at 21:21
add comment

1 Answer

up vote 8 down vote accepted

You can obtain a list of shared libraries that program is linked against with:

ldd `which program`
share|improve this answer
    
Ah, perfect. Thanks! –  Cornstalks Jul 16 '13 at 21:12
1  
six up votes for this? lol –  Ярослав Рахматуллин Jul 16 '13 at 22:46
    
Backticks are obsolete and should no longer be used. This is because you may confuse them with '' or even with ´´ which both have different meaning. The better way is to do it like this: ldd $(which program) –  l1zard Jul 16 '13 at 23:47
    
I like and prefer the backticks. They are nicer to look at and faster to type. If `, ", ', and ´ (the last one is not even ascii) are not visually distinct in a font, then that font is to blame. man bash(1) mentions this style of command substitution as old, but says nothing about obsolete. Is that your personal opinion? –  Ярослав Рахматуллин Jul 17 '13 at 14:28
add comment

Your Answer

 
discard

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.