歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 查看Linux系統網卡驅動程序

查看Linux系統網卡驅動程序

日期:2017/2/27 16:04:57   编辑:Linux教程
1. 無論是集成網卡還是獨立的網卡,都必須通過某種方式連接到PCI總線上,這樣的話,必定有有一個代號,這個代號可以通過下面的命令獲得:

# lspci | grep Ethernet
02:00.0 Ethernet controller: Atheros Communications AR8131 Gigabit Ethernet (rev c0)

最前面的 “02:00.0” 就是設備在PCI總線上的代號,該代號在整個系統中是唯一的。

2. 得到網卡的PCI代號之後,我們就可以在sysfs中查找它的驅動了,命令如下:

#find /sys/bus/pci/drivers/* | grep '02:00.0'
/sys/bus/pci/drivers/atheros_eth/0000:02:00.0

3. 通過上面的命令,我們可以發現,設備在“atheros_eth”文件夾下,也就是說,網卡的驅動就是atheros

總結一下以上整個過程可以用一個命令實現:

# find /sys/bus/pci/drivers/ | grep $(lspci | grep Ethernet | head -1 | awk '{print $1}') | awk -F/ '{print $6}'
Copyright © Linux教程網 All Rights Reserved