Remove the loaded module named example with modprobe.
Specify the module name and explicitly request removal.
Which command is correct?
modprobe -r removes the named module and can also process dependencies that are no longer needed.
Detailed explanation
modprobe -a exampleIncorrect. -a is used for adding or processing module arguments, not explicit removal.
Incorrect. -a is used for adding or processing module arguments, not explicit removal.
modprobe -r exampleCorrect. -r removes example with modprobe's dependency handling.
Correct. -r removes example with modprobe's dependency handling.
modprobe -n exampleIncorrect. -n is used for a dry run and does not perform removal.
Incorrect. -n is used for a dry run and does not perform removal.
modprobe -c exampleIncorrect. -c displays configuration rather than removing a module.
Incorrect. -c displays configuration rather than removing a module.
Try it yourself
An example you can run in a temporary verification environment.
modprobe --help | grep -E -- '--remove|-r,'Expected result
-rまたは--removeの説明Key points
- -r means remove
- A module in use normally cannot be removed
- A dry run does not change state
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.