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」參數可以顯示更多的資訊,並且也列出檔名為「.」開頭的檔案。