Last Updated : 10 Oct, 2024
The rmmod command in Linux is used to remove or unload a module from the kernel. Modules are pieces of code that can be dynamically loaded into the Linux kernel to extend its functionality, such as drivers for hardware devices. When a module is no longer needed, it can be removed using rmmod.
Although many users prefer to use the modprobe -r command for removing modules, rmmod directly unloads a module from the kernel.
Syntaxrmmod [options] [modulename]
where,
rmmod bluetoothKey Options for the rmmod Command 1. rmmod command with help option
It will print the general syntax of the rmmod along with the various options that can be used with the rmmod command as well as gives a brief description about each option.
Example:
2. rmmod -vThis option prints messages about what the program is being doing. Usually rmmod only prints messages only if something went wrong.
Example:
rmmod -v bluetooth3. rmmod -f
This option can be extremely dangerous. It takes no effect unless CONFIG_MODULE_FORCE_UNLOAD is being set when the kernel was compiled. With this option, you can remove the specified modules which are being used, or which are not being designed to be removed or have been marked as not safe.
Example:
sudo rmmod -f bluetooth4. rmmod -s
By default, error messages are sent to standard error. The -s option redirects error messages to the system log (syslog) instead of displaying them on the terminal.
Example:
rmmod -s bluetooth5. rmmod -V
This option will going to show version of program and then exit.
rmmod -VConclusion
The rmmod command in Linux provides a direct way to unload kernel modules from the system. If you're performing system maintenance, managing drivers, or troubleshooting, understanding how to use rmmod is essential. While the command is powerful, it should be used carefully, especially when forcing the removal of modules. In many cases, using modprobe -r may be safer due to its dependency handling.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4