Bootstrap FreeKB - Linux Commands - modinfo (view module information)
Linux Commands - modinfo (view module information)

Updated:   |  Linux Commands articles

The modinfo command with no options can be used to view detailed information about a module. The file for a certain module will be somewhere below the /lib/modules directory. In this example, detailed information about the cdrom module is displayed. If you are not certain the name of the module you want to view detailed information on, use the lsmod (list modules) command to list the currently loaded modules in the kernel.

[john.doe@server1 ~]# modinfo cdrom
filename:    /lib/modules/3.10.0-327.36.3.el7.x86_64/kernel/drivers/cdrom/cdrom.ko
license:     GPL
rhelversion: 7.2
srcversion:  BE3BD0D17D080229D55B173
depends:
intree:      Y
vermagic:    3.10.0-327.36.3.el7.x86_64 SMP mod_unload modversions
signer:      CentOS Linux kernel signing key
sig_key:     DB:7B:a4:DE:FE:A6:17:B4:B5:54:A2
sig_hashalgo:sha256
parm:        debug:bool
parm:        autoclose:bool
parm:        autoeject:bool
parm:        lockdoor:bool
parm:        check_media_type:bool
parm:        mrw_format_restart:bool

 


Field name

The -F or --field option can be used to display only a certain field. In this example, only the filename field is displayed.

[john.doe@server1 ~]# modinfo -F filename cdrom
filename:    /lib/modules/3.10.0-327.36.3.el7.x86_64/kernel/drivers/cdrom/cdrom.ko

 


Only display file name

The -n or --filename option can be used to only display the filename.

[john.doe@server1 ~]# modinfo -n cdrom
filename:    /lib/modules/3.10.0-327.36.3.el7.x86_64/kernel/drivers/cdrom/cdrom.ko

 


Only display license

The -l or --license option can be used to only display the license information.

[john.doe@server1 ~]# modinfo -l cdrom
license:     GPL

 


Only display parameters

The -p or --parameters option can be used to only display the parmeters information.

[john.doe@server1 ~]# modinfo -p cdrom
parm:        debug:bool
parm:        autoclose:bool
parm:        autoeject:bool
parm:        lockdoor:bool
parm:        check_media_type:bool
parm:        mrw_format_restart:bool

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 9623f2 in the box below so that we can be sure you are a human.