You need to inspect the shared libraries required by the trusted dynamically linked executable /bin/ls.
Do not modify the file.
Which command is appropriate?
ldd displays the shared-object dependencies of a dynamically linked executable and shows where each library resolves.
Detailed explanation
ldd /bin/lsCorrect. ldd lists the libraries required by /bin/ls and their resolved paths.
Correct. ldd lists the libraries required by /bin/ls and their resolved paths.
ldconfig /bin/lsIncorrect. ldconfig manages the linker cache and library links; it does not inspect one executable this way.
Incorrect. ldconfig manages the linker cache and library links; it does not inspect one executable this way.
lsmod /bin/lsIncorrect. lsmod lists loaded kernel modules.
Incorrect. lsmod lists loaded kernel modules.
modinfo /bin/lsIncorrect. modinfo displays metadata for a kernel module.
Incorrect. modinfo displays metadata for a kernel module.
Try it yourself
An example you can run in a temporary verification environment.
ldd /bin/lsExpected result
libc等のライブラリ名と解決パス。アーキテクチャにより内容は異なるKey points
- ldd checks dependencies
- A missing library appears as not found
- Avoid using ldd blindly on untrusted files
Notes
- Environment: Linux / glibc ldd
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.