lsmod

Linux · System · reference only

What it does

Shows the kernel modules that are loaded, with their size and which other modules use them.

Syntax

lsmod

Options and parameters

  • Module

    First column: name of the loaded module.

  • Size

    Second column: memory the module takes, in bytes.

  • Used by

    Third column: usage count and the modules that depend on it.

  • -h

    Shows help and exits.

  • -V

    Shows the version and exits.

Usage examples

  • lsmod

    Lists all loaded modules.

  • lsmod | grep -i usb

    Looks for USB-related modules.

  • lsmod | head -5

    Shows only the first lines of the table.

  • lsmod | wc -l

    Counts the lines of the table, one per module plus the header.

Notes and common mistakes

  • It reads its information from /proc/modules.
  • To load or remove modules you use modprobe and modprobe -r.

Related commands