lsmod Command in Linux



lsmod is a Linux command that allows you to display the status of modules in the Linux kernel. The modules are essentially pieces of code that you can load and unload into the kernel to extend its functionality, such as drivers for hardware components.

When you run lsmod, it lists all currently loaded kernel modules along with their sizes and the number of times they're being used. This command is pretty useful in case you want to troubleshoot hardware issues and ensure that the necessary drivers are active.

Table of Contents

Here is a comprehensive guide to the options available with the lsmod command −

Syntax of lsmod Command

To use the lsmod command, simply open your terminal and type −

lsmod

Running this command will give you a list of all the kernel modules that are currently loaded, including their sizes and how many times they're being used.

lsmod Command Options

There are no extra options for lsmod, as its main purpose is to provide a quick snapshot of the active kernel modules on your system.

How to Use lsmod Command in Linux?

To use the Linux lsmod command, simply open the terminal and execute the command without an option −

lsmod

This command will display a list of all kernel modules that are currently loaded on your system.

lsmod Command in Linux1

The output of the lsmod command includes three main columns −

  • Module − The name of the loaded kernel module.
  • Size − The size of the module in memory, shown in bytes.
  • Used by − The number of instances using this module and the names of dependent modules.

Conclusion

The lsmod is a versatile command used in Linux to check the status of kernel modules. It lists all currently loaded modules, their sizes and usage count. This makes it an essential tool for troubleshooting hardware issues and ensuring necessary drivers are active.

In this brief tutorial, we covered the syntax, available options, and practical use cases for the lsmod command, equipping you with the knowledge to utilize this tool effectively. Understanding this will help you verify which modules are in use and troubleshoot hardware issues on Linux systems.

Advertisements