Search code examples
linuxlinux-kerneldevice-driver

How can i get the list of all initialized device drivers in a running Linux kernel?


How can i get the list of all initialized device drivers in a running Linux kernel?

Note that device driver is not the same as module.

There is a related question: How can I get a list of all the active kernel drivers on my Android system?


Solution

  • each device driver is attached to some bus, and each bus has a "drivers" directory in sysfs, so something like the following shell command would print each bus and its registered drivers

    cd /sys/bus; for bus in $(ls); do echo $bus; ls -1 $bus/drivers; echo; done
    

    sample output:

    scsi
    sd
    sr
    
    sdio
    
    serio
    atkbd
    psmouse
    serio_raw