What Is the lsmod Command in Linux?

This article provides a comprehensive overview of the lsmod command in the Linux operating system, explaining its primary purpose, how it functions, and how to interpret its output. You will learn how system administrators use lsmod to inspect currently loaded kernel modules, troubleshoot hardware driver issues, and analyze module dependencies to maintain system stability.

The lsmod (list modules) command is a fundamental Linux utility used to display the status of modules currently loaded into the Linux kernel. The Linux kernel uses Loadable Kernel Modules (LKMs) to extend its functionality on the fly—such as adding support for hardware devices, file systems, or network protocols—without requiring a full system reboot. The lsmod command provides an immediate snapshot of these active components.

Technically, lsmod does not perform complex queries on its own. Instead, it accesses the /proc/modules virtual file, parses its raw contents, and presents the data in a clean, human-readable table.

When you run lsmod in a terminal, the output is organized into three distinct columns:

  1. Module: The name of the currently loaded kernel module.
  2. Size: The amount of memory occupied by the module in RAM, displayed in bytes.
  3. Used by: This column displays two key pieces of information: a count of how many processes or other modules are currently using it, followed by a comma-separated list of the specific dependent modules. If a module shows a count of zero and no listed dependents, it is currently unused and can typically be safely unloaded.

The primary use cases for the lsmod command include:

While lsmod is dedicated strictly to viewing active modules, it works alongside utilities like modprobe (used to load and unload modules along with their dependencies) and modinfo (used to view detailed metadata about a specific module). Together, these tools form the core toolkit for Linux kernel module management.