How to Use the lsmod Command in Linux to View Loaded Kernel Modules

The Linux kernel is designed to be highly modular. Instead of compiling every single device driver and filesystem capability directly into a massive core operating system, Linux uses \”kernel modules\” (usually files ending in .ko). These modules are dynamic pieces of code—such as drivers for Wi-Fi cards, USB controllers, or specialized filesystems—that the kernel can load into RAM on the fly when hardware is detected, and unload when it is not needed. To see exactly which modules are currently active and consuming memory, administrators use the lsmod command.

Why Use the lsmod Command?

When troubleshooting a hardware issue—for example, if a newly connected Bluetooth dongle or a specialized graphics card is not functioning—the first diagnostic step is verifying if the Linux kernel has actually loaded the necessary driver. The lsmod command (List Modules) provides a formatted, real-time snapshot of every module currently loaded into the kernel space. It also reveals module dependencies, showing which drivers rely on other drivers to function, which is critical information when attempting to safely remove a conflicting module.

Step 1: View All Loaded Kernel Modules

The command is extremely simple and requires no root privileges to run.

  1. Open your Linux terminal.
  2. Type the following command and press Enter:
lsmod

The output will be a three-column table detailing everything currently running in the kernel.

Step 2: Understand the Output Columns

The lsmod table provides three crucial pieces of data for every entry.

  1. Module: The exact name of the loaded module (e.g., btusb for Bluetooth USB drivers).
  2. Size: The amount of RAM (in bytes) the module is actively consuming.
  3. Used by: A number indicating how many other components are currently using this module, followed by a comma-separated list of the dependent modules. If the number is 0, the module is loaded but inactive, meaning it could potentially be safely unloaded (using rmmod) to save memory.

Step 3: Search for a Specific Hardware Driver

Because the lsmod output can be over 100 lines long, scrolling through it to find a specific driver is inefficient. You should pipe the output into the grep command to filter the results.

  1. If your Wi-Fi is failing, you might want to check if the Intel wireless module (iwlwifi) is loaded:
lsmod | grep iwlwifi

If the command returns nothing, it mathematically proves the kernel has not loaded the driver, meaning the hardware is either unsupported or the module blacklisted.

Step 4: Use modinfo for Deeper Technical Details

While lsmod tells you that a module is loaded, it doesn’t tell you exactly what it does. If you find an unfamiliar module in your lsmod list, you can query it directly.

  1. Copy the name of the module from the lsmod output.
  2. Run the modinfo command. For example:
modinfo nls_utf8

This will output the module’s description, the author, the license, and the exact absolute file path where the .ko module file resides on your hard drive.

By effectively using the lsmod command, Linux administrators can diagnose complex driver failures, audit kernel memory usage, and ensure hardware is properly initialized.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.