Inspect the shared libraries registered in the dynamic linker's cache.
Display the cache without rebuilding it.
Which command is appropriate?
ldconfig -p prints the libraries currently registered in the linker cache, including ABI information and resolved paths.
Detailed explanation
ldconfig -vIncorrect. -v displays verbose processing information and is not the cache-print option.
Incorrect. -v displays verbose processing information and is not the cache-print option.
ldconfig -pCorrect. ldconfig -p prints the current cache entries.
Correct. ldconfig -p prints the current cache entries.
ldconfig -CIncorrect. -C selects a cache file; it does not mean print the cache.
Incorrect. -C selects a cache file; it does not mean print the cache.
ldconfig -XIncorrect. -X suppresses library-link updates and does not print the cache.
Incorrect. -X suppresses library-link updates and does not print the cache.
Try it yourself
An example you can run in a temporary verification environment.
ldconfig -p | headExpected result
キャッシュ件数とライブラリ名・パスの先頭部分Key points
- -p prints the cache
- The operation is read-only
- Use the names to locate the actual library paths
Notes
- Environment: Linux / glibc ldconfig
- 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.