Howto: Display list of modules or device drivers in the Linux Kernel

by on September 14, 2006 · 6 comments· last updated at September 14, 2006

Q. How do I display list of loaded Linux Kernel modules or device drivers?

A. You need to use lsmod program which show the status of loaded modules in the Linux Kernel. Linux use term modules for hardware device drivers.

lsmod is a trivial program which nicely formats the contents of the /proc/modules, showing what kernel modules are currently loaded.

This is an important task. With lsmod you can verify that device driver is loaded for particular hardware. Any hardware device will only work if device driver is loaded.

Task: List or display loaded modules

$ less /proc/modules
$ lsmod

Output:

Module                  Size  Used by
snd_mixer_oss          20096  0
i830                   78596  2
sg                     39168  0
ppdev                   9924  0
sr_mod                 17316  0
vmnet                  39032  12
vmmon                 111788  0
ipv6                  264772  12
ipt_LOG                 6560  1
ipt_state               2080  1
ip_conntrack_ftp       72368  0
iptable_mangle          2880  0
iptable_nat            25156  0
ip_conntrack           35756  3 ipt_state,ip_conntrack_ftp,iptable_nat
....
..
....

First column is Module name and second column is size of modules i..e the output format is module name, size, use count, list of referring modules.



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 6 comments… read them below or add one }

1 Harshal February 18, 2008 at 11:00 am

Is there any way by which I can know for example “xyz” module is for “xyz” hardware?

Reply

2 Harshal February 18, 2008 at 11:03 am

Sorry for another comment…

Actually my objective is to find what device drivers(modules) are loaded for my hardware and is there any hardware which doesn’t have the right module installed for it.

Thanks
Harshal.

Reply

3 Alex October 14, 2008 at 1:36 pm

@Harshal
Hey!

Maybe it is a little bit late, but try out this command: “lspci -v”.

It’ll show a huge list of all PCI devices and all kind of information INCLUDING the current used module.

Hope, it helps.

Alex

Reply

4 mike October 3, 2009 at 3:18 pm

helped me thanks.
what command would i use to output the above commands directly to a file?
thanks again

Reply

5 Alex October 3, 2009 at 5:35 pm

Use the directing “>” symbol.
E.g.
lspci -v > filename.txt

Alex

Reply

6 Ruphus May 23, 2012 at 2:25 pm

Hi,

what about listing modules which are *NOT* loaded in the kernel?
I.E finding out what’s supported with your kernel?

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as:

Previous Faq:

Next Faq: