Identify a conventional location for distribution-managed system shared libraries.
Account for differences such as multiarch and lib64 layouts.
Which directory is appropriate?
Shared libraries are commonly under /lib, /usr/lib, or architecture-specific lib64 and multiarch subdirectories. The exact path depends on the distribution and ABI.
Detailed explanation
/var/logIncorrect. /var/log is for log data.
Incorrect. /var/log is for log data.
/libや/usr/lib系Correct. /lib and /usr/lib families are standard shared-library locations, with distribution-specific subdirectories.
Correct. /lib and /usr/lib families are standard shared-library locations, with distribution-specific subdirectories.
/homeIncorrect. /home stores user data.
Incorrect. /home stores user data.
/procIncorrect. /proc is a virtual kernel filesystem.
Incorrect. /proc is a virtual kernel filesystem.
Try it yourself
An example you can run in a temporary verification environment.
find /lib /usr/lib -maxdepth 2 -type f -name 'libc.so*' 2>/dev/null | headExpected result
libc共有ライブラリの実体パス。環境によりmultiarch配下等になるKey points
- Use /lib and /usr/lib families
- ABI-specific subdirectories are possible
- SONAME links may point to the real file
Notes
- Environment: Linux / FHS・multiarch構成
- 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.