Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to determine the driver used in the network card under Linux

Shulou Source: shulou.com Published: 2022-06-01 13:07:17 09月29日 Update

This article mainly explains "how to determine the driver used by the network card under Linux". The content in the article is simple and clear, and it is easy to learn and understand. Please follow Xiaobian's train of thought to study and learn "how to determine the driver used by the network card under Linux".

1. Whether it is an integrated network card or an independent network card, it must be connected to the PCI bus in some way, so that there must be a code name that can be obtained through the following command:

# lspci | grep Ethernet 02Ethernet controller 00.0 Ethernet controller: Intel Corporation 80003ES2LAN Gigabit Ethernet Controller (Copper) (rev 01)

The first "02 00.0" is the code name of the device on the PCI bus, which is * * in the whole system.

two。 After getting the PCI code of the network card, we can find its driver in sysfs, as follows:

# cd / sys/bus/pci/drivers # find | grep '02VR 00.0'. / e1000e/0000:02:00.0

3. Through the above command, we can find that the device is under the "e1000e" folder, that is, the driver of the network card is e1000e.

4. In summary, on the Linux system, the command to find the driver being used by the network card is as follows:

# code=$ (lspci | grep Ethernet | head-1 | awk'{print $1}') # find / sys/bus/pci/drivers/ | grep $code | awk-F /'{print $6}'

Or

# find / sys/bus/pci/drivers/ | grep $(lspci | grep Ethernet | head-1 | awk'{print $1}') | awk-F /'{print $6} 'Thank you for reading. The above is the content of "how to determine the driver used in the network card under Linux". After the study of this article, I believe you have a deeper understanding of how to determine the driver used in the network card under Linux. The specific use situation still needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Network card driver code program driver command that is learning content bus system device face that is that is it can be summarized ideas situations. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Huawei Linux Shulou Technology Apple