In order to find all library dependencies of /usr/bin/foo, which of the following statement is true?
A. Running ldconfig against /usr/bin/foo will show the required libraries
B. Running ldd against /usr/bin/foo will show the required libraries
C. It's necessary to compile the program again to check the library dependencies of foo.
D. The ls -la command has to be run in the /usr/bin directory, to show all library dependencies of foo.
E. Library dependencies are shown in the /usr/lib directory.
题解
使用「ldd」指令可以显示程序或是函数库与其它共享对象(动态函数库)的关联。可使用以下指令来查看「/usr/bin/foo」有用到哪些共享对象:
ldd /usr/bin/foo
所以答案是选项 B。
选项 A,「ldconfig」指令用来设置运行阶段时的动态函数库。
选项 D,「ls」指令用来列出目录的内容,加上「-la」参数可以显示更多的信息,并且也列出文件名为「.」开头的文件。
