rmmod command is used to remove modules or unused modules from the Linux Kernel. As well as modprobe, rmmod is a part of kmod.
But in most cases, you should use modprobe -r instead of rmmod because it has a stronger impact without any dependencies.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Linux System queries.
In this context, we shall look into how to use the rmmod command in Linux.
What is the syntax of rmmod command ?
To remove a Linux kernel module, run rmmod provided you are root user:
$ rmmod [options] module_name
This command provides the follow options:
- -v, –verbose show information.
- -f, –force remove modules that is being used or not designer to be removed.
- -w, –wait isolate module and wait until module is longer in use.
- -s, –syslog send errors to syslog instead of to the terminal.
- -V, –version show rmmod's version information, and exit.
You can use lsmod command to check which modules are already loaded.
Now to remove any module such as "test_module" with rmmod, simply run the following query:
$ sudo rmmod -f test_module
To confirm if nfit is removed, simply use the lsmod command:
$ lsmod | grep test_module
So, if test_module is removed, nothing will show up in the output.
rmmod also accepts deleting multiple modules as shown below:
$ rmmod module_name1 module_name2
[Need help in Installing Open Source Software on Debian Linux System? We can help you. ]