Linux上的设备管理器

本文介绍在Linux环境下如何使用命令行工具进行驱动程序的查看、安装与卸载操作。包括使用lshw、lsusb等命令查看系统硬件及驱动状态,modprobe与insmod安装驱动,以及modprobe -r和rmmod卸载驱动的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一般windows上我们用它自带的“设备管理器”来查看,管理,安装,卸载驱动。

那么问题来了,Linux上用什么命令来看呢?

可以用:

lshw   lsusb lspci lsmod

 

查看特定模块、驱动的详细信息

 modinfo [device name]

显示已加载的模块

$ less /proc/modules

当然,lsmod命令显示已加载模块输出的格式更好。

 

 

安装,和卸载模块/驱动:

 一般来说, 所有的Linux内核模块(驱动)都储存在/lib/modules/$(uname -r) 的模块目录下。

可以用以下命令来查看不同设备的驱动程序:

ls /lib/modules/$(uname -r)/kernel/drivers/

 

安装模块(驱动):

modprobe -v [module name]      (这个命令需要.ko文件被放在/lib/modules/$(uname -r) 目录下,才能找到,不然会报                     FATAL: Module XXX.ko not found.的错误,注意,模块名不能加后缀.ko)

 insmod [module file name]          example: insmod /path/myDriver.ko                     (不建议使用这个命令,因为不解决驱动依赖问题)

删除模块(驱动):

modprobe -r [module name]

rmmod [module name]

 

 

 

 

 

 

references:

http://woshixiguapi.blog.163.com/blog/static/1924996920111121396494/

http://www.linuxquestions.org/questions/linux-software-2/command-to-know-the-list-of-drivers-installed-on-my-linux-system-948384/

http://xmodulo.com/how-to-check-graphics-card-on-linux.html

http://www.cyberciti.biz/faq/howto-display-list-of-modules-or-device-drivers-in-the-linux-kernel/

http://www.cyberciti.biz/faq/add-remove-list-linux-kernel-modules/

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值