LinuxCommandLibrary

kmod

Manage Linux kernel modules

TLDR

List currently loaded kernel modules

$ kmod list
copy

Display the static device nodes information provided by the modules of the currently running kernel
$ kmod static-nodes
copy

SYNOPSIS

kmod [options] <subcommand> [<args>...]

PARAMETERS

--kmod-config=PATH
    Load configuration from PATH. Defaults to /run/kmod/config or /etc/kmod.conf.

--config-dir=PATH
    Additional config dirs. Defaults: /lib/kmod/config.d/, /run/kmod/config.d/, /etc/kmod/config.d/.

--no-syslog
    Suppress syslog error logging.

--debug[=LEVEL]
    Debug level 0-10. Default: 0.

-v, --verbose
    Increase output verbosity.

-q, --quiet
    Decrease output verbosity.

--version
    Display version information.

-h, --help, -?
    Show help message.

DESCRIPTION

kmod is a comprehensive set of tools for managing Linux kernel modules. It serves as a unified binary that provides functionality equivalent to traditional commands like modprobe, insmod, rmmod, lsmod, modinfo, and depmod. Built on top of the libkmod library, kmod handles module loading, unloading, dependency resolution, alias lookups, blacklisting, signing, and more.

It resolves module dependencies automatically, supports firmware loading, and integrates with kernel configuration. kmod is designed for efficiency and extensibility, using modern parsing for modules.dep and aliases. Commonly invoked via symlinks to specific subcommands, it is the standard in distributions like Fedora, Ubuntu, and Arch Linux. Most operations require root privileges and interact directly with the kernel via /sys/module and /proc/modules.

kmod emphasizes security with features like module signing verification and avoids deprecated paths from older tools.

CAVEATS

Requires root for most subcommands; misuse can cause kernel panics or system instability. Not all legacy module-init-tools behaviors are preserved.

COMMON SUBCOMMANDS

modprobe: Load/unload with deps.
insmod: Insert module.
rmmod: Remove module.
lsmod: List loaded.
depmod: Generate deps.
Others: blacklist, sign, hwdb.

HISTORY

Developed by Lucas De Marchi starting 2011 as a replacement for unmaintained module-init-tools (1996-2011). Integrated libkmod for shared functionality. Adopted widely post-2012 in RPM/Debian distros; version 28+ aligns with modern kernels.

SEE ALSO

modprobe(8), insmod(8), rmmod(8), lsmod(8), depmod(8), modinfo(8)

Copied to clipboard