Inspect module names, sizes, and usage counts for modules currently loaded into the kernel.
Do not change system state.
Which command is appropriate?
lsmod displays the currently loaded kernel modules and their size and usage information without changing state.
Detailed explanation
modprobe -aIncorrect. modprobe -a loads modules rather than simply listing the current state.
Incorrect. modprobe -a loads modules rather than simply listing the current state.
modinfoIncorrect. modinfo reports metadata for a named module and is not the loaded-module list.
Incorrect. modinfo reports metadata for a named module and is not the loaded-module list.
depmodIncorrect. depmod generates module dependency information.
Incorrect. depmod generates module dependency information.
lsmodCorrect. lsmod lists loaded modules and usage information.
Correct. lsmod lists loaded modules and usage information.
Try it yourself
An example you can run in a temporary verification environment.
lsmod | headExpected result
Module、Size、Used byの見出しとロード済みモジュール(環境により内容は異なる)Key points
- lsmod inspects current state
- modinfo describes one module
- depmod builds dependency data
Notes
- Environment: Linux / kmod 30以降
- 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.