Linux modinfo command

Updated: 03/13/2021 by Computer Hope
modinfo command

On Linux operating systems, the modinfo command shows information about a module inserted in the kernel.

Description

The modinfo command extracts information from the Linux kernel modules given on the command line. If module name is not a file name, then the /lib/modules/kernel-version directory is searched — the same directory searched by modprobe when loading kernel modules.

By default, modinfo lists each attribute of the module in the form:

field name : value

The module file name is listed the same way.

modinfo can understand modules of any Linux kernel architecture.

Syntax

modinfo [-0] [-F field] [-k kernel] [module name|file name...]
modinfo -V
modinfo -h

Options

-V, --version Print the version of modinfo, and exit.
-F,
--field field name
Only print the value of the field named field name. Field names are case-insensitive. Common field names are author, description, license, parm, depends, and alias. There are often multiple fields for a given field name, for instance parm, alias, and depends. Multiple values are printed one per line. The special field name, file name, lists the file name of the module.
-k kernel Provide information about a kernel other than the running one. This switch is particularly useful for distributions needing to extract information from a newly-installed (but not yet running) set of kernel modules.
-0, --null Use the ASCII (American Standard Code for Information Interchange) NULL character to separate field values, instead of a newline. This switch is useful for parsing field data, because a newline might be part of a field's value.
-a, -d, -l, -p, -n These are shortcuts for displaying the fields author, description, license, parm, and file name.

Examples

modinfo snd

Display all available information about the snd Linux kernel module. Output resembles the following:

file name:       /lib/modules/3.2.0-4-686-pae/kernel/sound/core/snd.ko
alias:          char-major-116-*
license:        GPL
description:    Advanced Linux Sound Architecture driver for sound cards.
author:         Jaroslav Kysela <[email protected]>
license:        GPL
description:    Jack detection support for ALSA
author:         Mark Brown <[email protected]>
depends:        soundcore
intree:         Y
vermagic:       3.2.0-4-686-pae SMP mod_unload modversions 686 
parm:           slots:Module names assigned to the slots. (array of charp)
parm:           major:Major # for sound driver. (int)
parm:           cards_limit:Count of auto-loadable sound cards. (int)
modinfo -F parm snd

Display all parm (parameter) fields for the snd Linux kernel module. Output resembles the following (note that the field name does not prefix the field values):

slots:Module names assigned to the slots. (array of charp)
major:Major # for sound driver. (int)
cards_limit:Count of auto-loadable sound cards. (int)

depmod — Generate a list of kernel module dependencies and associated map files.
insmod — Insert a module into the Linux kernel.
lsmod — Show the status of Linux kernel modules.
modprobe — Add and remove modules from the Linux kernel.
rmmod — Remove a module from the Linux kernel.