System and processes

The modinfo command

Shows a module's record without loading it: file, license and dependencies.

Syntax

modinfo <modulo>Try it in the terminal →

Most useful options

-F, --field <campo>Prints only that field, one per line. Field names are case-insensitive. Ideal for scripts
-0, --nullSeparates values with a null byte instead of a newline, in case a value contains newlines
-k <versión>Reads the modules of another installed kernel, not the one running
-b, --basedir <directorio>Root directory where modules are searched. The default is /
-a, --authorShortcut for -F author: shows the module's author
-d, --descriptionShortcut for -F description: shows the description
-l, --licenseShortcut for -F license: shows the license
-p, --parametersShortcut for -F parm: shows the parameters the module accepts

Copy-ready examples

$ modinfo ext4full record: file, description, license, parameters and dependencies.
$ modinfo -F depends ext4only the module's dependencies.
$ modinfo -F license ext4only the license, to check it in a script.
$ modinfo -0 -F alias ext4 | tr '\0' '\n'the aliases, one per line: alternative names the module can be requested by.

You can try them in the browser terminal: it does not touch your computer.

Common errors

MessageCauseFix
modinfo: ERROR: Module name foo not found.There is no module with that name in the running kernel. Usually a typo, or a module that is not installed.Find the file with find /lib/modules/$(uname -r) -name '*foo*', or pass the full path to the .ko file.
modinfo: ERROR: missing module or filename.It was run without a module name or file path.Add the name: modinfo ext4.

Typical mistakes

  • modinfo reads the module file and does not say whether it is active. To know what is loaded now, use lsmod.
  • Not every module has every field: if one does not exist, it simply does not appear in the output.
  • The normal output is meant for reading, not for parsing: in scripts use -F, which prints one field per line.

Differences from similar commands

  • lsmod: shows the modules loaded right now. modinfo reads the record of any module, loaded or not.
  • modprobe: loads or unloads the module. modinfo only reads its file and does not touch it.

Related commands

FAQ

What do parm and alias mean in the output?

parm are the parameters the module accepts, passed when loading it as name=value. alias are alternative names the module can be requested by.

Why do aliases and install commands not show up in the dependencies?

Because modinfo reads only the module file: it knows nothing about aliases or the install commands in modprobe.d. For that, use modprobe --show-depends.

Can I see the record of a module from another kernel?

Yes, with -k giving the installed version, or with -b if the modules are under another root. Useful to check a newly installed kernel without booting it.

More System and processes commands

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course