×


List Loaded Kernel Module Using Lsmod Command - How it works ?

The lsmod command is used to display loaded kernel modules. Kernel modules are code snippets that can be loaded or unloaded to the kernel on demand. If you want to load modules, you can use the modprobe command. The modules are fully listed in /etc/modules-load.d/<program>.conf file.

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Linux System command queries.

In this context, we shall look into how to list loaded kernel modules using lsmod command.


lsmod command syntax

lsmod command takes the following form:

$ lsmod

This command usually displays three columns in the terminal.

  • 1st column: the names of loaded modules.
  • 2nd column: the memory capacity of each module.
  • 3rd column: the total number of uses and optionally the name of the module.


You can use another way to search a specific module by the grep command. For example, we wanted to search a module named "xor":

$ lsmod | grep xor

To get more information about kernel modules, we will use the modinfo command. For example:

$ sudo modinfo xor


[Need assistance in searching for Installed Linux system packages? We can help you. ]


Conclusion

This article covers how to list loaded kernel modules using lsmod command. In fact, lsmod command nicely prints the contents of the /proc/modules. To list the currently loaded kernel modules, execute the below command:

$ lsmod