Inspect the hierarchy of devices, buses, drivers, and classes recognized by the kernel.
Read the virtual filesystem that exposes kernel objects.
Which directory should be inspected?
sysfs mounted at /sys represents devices, buses, classes, and drivers as a kernel object hierarchy.
Detailed explanation
/bootIncorrect. /boot contains boot-related files rather than the live device model.
Incorrect. /boot contains boot-related files rather than the live device model.
/runIncorrect. /run contains runtime state.
Incorrect. /run contains runtime state.
/sysCorrect. /sys exposes the kernel device hierarchy through sysfs.
Correct. /sys exposes the kernel device hierarchy through sysfs.
/optIncorrect. /opt is conventionally for optional software.
Incorrect. /opt is conventionally for optional software.
Try it yourself
An example you can run in a temporary verification environment.
find /sys -maxdepth 1 -type d -printf '%f\n' | sortExpected result
block、bus、class、devices、moduleなど(環境により差がある)Key points
- /sys is sysfs
- The device model is hierarchical
- /dev contains device nodes
Notes
- Environment: Linux / sysfs
- 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.