How do you check the version of a *.ko kernel module in Linux?

I know you can do:

sudo modprobe -v some_module

to check the version of /lib/modules/.../some_module.ko, but I'd still like to be able to check the version of any arbitrary kernel module that's not necessarily going to be loaded by modprobe.


Solution 1:

modinfo(8)
modinfo - program to show information about a Linux Kernel module

Simply,

modinfo module-file

General tip: At the bottom of a manpage and there is a section called "See Also". For modprobe, it lists modinfo. That section can be extremely useful.

Solution 2:

Try:

strings some_module.ko | grep vermagic

Or use as mentioned by Ian Kelling modinfo.