How to determine if a specific module is loaded in linux kernel

前端 未结 9 1600
谎友^
谎友^ 2021-02-01 14:28

I am just curious is there any way to determine if a particular module is loaded/installed.

$lsmod lists all modules (device driver loaded).

Is there any way to

9条回答
  •  长发绾君心
    2021-02-01 15:01

    not sure if modinfo modname and checking $? will work for you, just a suggestion.

    /tmp$ sudo modinfo e1000
    /tmp$ echo $?
    0
    /tmp$ sudo modinfo keyboard
    ERROR: modinfo: could not find module keyboard
    /tmp$ echo $?
    1
    

    alternatively you also grep /proc/modules

提交回复
热议问题