modinfo command in Linux with Examples
Last Updated :
25 Sep, 2024
The modinfo command in Linux is used to display information about a Linux kernel module. It extracts detailed information from the modules available in the system and provides insights into their properties, dependencies, parameters, and more. If the module name is provided without a file name, the command automatically searches the ‘/lib/modules/kernel-version‘ directory for the specified kernel version.
The modinfo command is compatible with all Linux Kernel architectures, making it a versatile tool for system administrators, developers, and users working with kernel modules.
Syntax
modinfo [-0] [-F field] [-k kernel] [modulename|filename...]
Basic modinfo Command Example
The below command displays information about the Bluetooth module, including the module’s author, description, license, dependencies, and more.
modinfo bluetooth

Key Options Used with the modinfo command
1. modinfo –help
It will print the general syntax of the modinfo along with the various options and gives a brief description about each option.
Example:
modinfo --help

2. modinfo -V:
This option gives the version information of modinfo command.
Example:
modinfo -V

3. modinfo -F:
This option only print this field value, one per line. Field names are case-insensitive. Common fields that may include author, description, license, parm, depends, and alias. There are possibly multiple parm, alias and depends on fields. The special field filename lists are the filename of the module.
Example:
modinfo -F modulename
4. modinfo -b:
This option is the root directory for modules.
Example:
modinfo -b modulename
5. modinfo -k:
This option provides the information about a kernel other than the running one. This option is particularly being useful for the distributions that need to extract information from a newly installed set of kernel modules.
For example, to find which firmware files are needed by various modules inside a new kernel for which you need to make an ‘initrd/initramfs’ image prior to booting.
modinfo -k modulename
6. modinfo -0:
This option use the ASCII zero character to separate field values, instead of a new line. This option is proven useful for scripts since a new line can theoretically appear inside a field.
Example:
modinfo bluetooth -0

7. modinfo -a –author, -d –description, -l –license, -p –parameters, -n –filename:
These are the shortcuts used for the –field flag’s author, description, license, parm and filename arguments to make the transition from the old modutils modinfo easy.
Example:
modinfo bluetooth -a

modinfo bluetooth -n

modinfo bluetooth -d

modinfo bluetooth -l

modinfo bluetooth -p

Conclusion
The modinfo command is used for inspecting and managing Linux kernel modules. It allows users to quickly access critical information about kernel modules, such as authorship, dependencies, parameters, and more. Its various options allow for detailed customization of the output, making it suitable for a wide range of use cases, from diagnostics to kernel development.
Similar Reads
locate command in Linux with Examples
locate command in Linux is used to find the files by name. There are two most widely used file-searching utilities accessible to users called to find and locate. The locate utility works better and faster than the find command counterpart because instead of searching the file system when a file sear
7 min read
look command in Linux with Examples
The look command in Linux is used to display lines that begin with a specified string. It is especially useful for searching through large files or lists, as it helps you locate entries efficiently. By default, the look command performs case-insensitive matches and searches for exact prefixes. The l
3 min read
How to List All Block Devices in Linux | lsblk Command
Understanding the storage devices connected to your Linux system is crucial for efficient system management. The 'lsblk' command, short for "list block devices," is a powerful tool that provides detailed information about block devices such as hard drives, solid-state drives, and other storage-relat
7 min read
lshw command in Linux with Examples
The 'lshw' (List Hardware) command in Linux/Unix is a powerful tool for extracting detailed information about the system's hardware configuration. This tool retrieves data from files in the '/proc' directory and is capable of reporting on a wide array of components, including memory configuration, C
3 min read
lsmod command in Linux with Examples
lsmod command is used to display the status of modules in the Linux kernel. It results in a list of loaded modules. lsmod is a trivial program which nicely formats the contents of the /proc/modules, showing what kernel modules are currently loaded. Syntax: lsmod Example: Run lsmod at the command lin
1 min read
How to List Open Files in Linux | lsof Command
In the world of Linux, understanding and managing open files is crucial for system administrators and users alike. The Linux operating system provides a powerful utility called lsof (List Open Files) that allows users to gain insights into the files currently open on their system. In this article, w
7 min read
lsusb command in Linux with Examples
The 'lsusb' command in Linux is a useful utility for displaying information about USB buses and the devices connected to them. It provides a detailed view of the USB hardware connected to your system, including details such as speed, bus number, device class, and type. This command is particularly v
2 min read
mailq Command in Linux with Examples
mailq i.e. "mail-queue", this command in Linux prints the mail queue i.e. the list of messages that are there in the mail queue. You should have a mail-server setup on your Linux machine, to use this command, there are ways i.e MTA's(Mail Transfer agent) you can use like sendmail which uses the serv
3 min read
How to Read Manual Pages in Linux | man Command
The "man" command, short for manual, is a powerful tool in the Linux operating system that allows users to access detailed information about various commands, utilities, and system calls. The "man" command provides comprehensive documentation, helping users understand how to use and configure differ
9 min read
md5sum Command in Linux with Examples
The md5sum is designed to verify data integrity using MD5 (Message Digest Algorithm 5). MD5 is 128-bit cryptographic hash and if used properly it can be used to verify file authenticity and integrity. Example : Input : md5sum /home/mandeep/test/test.cppOutput : c6779ec2960296ed9a04f08d67f64422 /home
5 min read