linux下显示网卡设备及驱动信息intel shell脚本
intel 发布的, 需具备有lspci 及ethtool 两个命令. 用户查看网卡信息非常方便
#! /bin/bash #****************************************************************************** # Copyright(c) 1999 - 2008 Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This program is distributed in the hope it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. # # Contact Information: # Linux NICS <linux.nics@intel.com> # Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 #****************************************************************************** #Determine how many Ethernet & Network controllers are installed in the system TotalControllers=`lspci | grep -c -i 'Ethernet Controller/|Network Controller'` temp=`lspci | grep -i 'Ethernet Controller/|Network Controller'|cut -f1 -d " "` #Define two arrays for storing IPPorts declare -a IOPorts1 declare -a IOPorts2 #Populate IOPorts1 with bus info from lspci. Populate IoPorts2 with bus info #from ethtool. for (( counter=0 ; counter < $TotalControllers ; counter++ )) do offset=$(($counter+1)) IOPorts1[$counter]=`echo $temp|cut -f$offset -d" "` if (ethtool -i eth$counter) &> /dev/null; then IOPorts2[$counter]=`ethtool -i eth$counter|grep 'bus-info'|cut -f3- -d :` fi done #Loop through both arrays and determine if there's a match in IOPort1 & IOPort2. If so #then the driver is loaded, and write to screen all the related information. If there #is no match then there isn't a driver loaded for that device and write to screen only #the information available from lspci for ((counter=0 ; counter < $TotalControllers ; counter++)) do Match=0 for ((counter1=0 ; counter1 < $TotalControllers; counter1++)) do if [ "${IOPorts1[$counter]}" = "${IOPorts2[$counter1]}" ]; then Match=1 DeviceID=`lspci -nn | grep ${IOPorts2[$counter1]} |cut -f3- -d"["| cut -c 1-9` EthernetController=`lspci -v |grep ${IOPorts2[$counter1]} | cut -f4- -d" "|cut -f1 -d"("` AdapterName=`lspci -v | grep ${IOPorts2[$counter1]} -A 1 | grep 'Subsystem'|cut -f2- -d" "` DriverName=`ethtool -i eth$counter1 | grep -i 'driver' | cut -f2 -d" "` DriverVersion=`ethtool -i eth$counter1 | grep -m 1 -i 'version'| cut -f2 -d" "` echo "eth$counter1 : ${IOPorts2[$counter1]}" echo " Make/Model = $AdapterName" echo " Ethernet controller = $EthernetController" echo " VenID:DevID = $DeviceID" echo " Driver name = $DriverName" echo " Driver version = $DriverVersion" fi done if [ "$Match" = "0" ] ; then DeviceID=`lspci -nn | grep ${IOPorts1[$counter]} |cut -f3- -d"["| cut -c 1-9` EthernetController=`lspci -v |grep ${IOPorts1[$counter]} | cut -f4- -d" "|cut -f1 -d"("` AdapterName=`lspci -v | grep ${IOPorts1[$counter]} -A 1 | grep 'Subsystem'|cut -f2- -d" "` echo ": ${IOPorts1[$counter]}" echo " Make/Model = $AdapterName" echo " Ethernet controller = $EthernetController" echo " VenID:DevID = $DeviceID" echo " Driver name = No driver loaded" echo " Driver version = No driver loaded" fi done exit 0
linux下显示网卡设备及驱动信息intel shell脚本相关推荐
- Linux下Rtl8139too网卡设备驱动程序关键函数剖析
static int __devinit rtl8139_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) 函数功能描述 ...
- linux查看网卡的驱动命令行,Linux下查看网卡驱动和版本信息
Linux下查看网卡驱动和版本信息 查看网卡生产厂商和信号 查看基本信息:lspci 查看详细信息:lspci -vvv # 3个小写的v 查看网卡信息:lspci | grep Ethernet 查 ...
- linux查看当前igb的版本信息,Linux下查看网卡驱动和版本信息
Linux下查看网卡驱动和版本信息 查看网卡生产厂商和信号 查看基本信息:lspci 查看详细信息:lspci -vvv # 3个小写的v 查看网卡信息:lspci | grep Ethernet ...
- linux命令查看驱动,Linux下查看网卡驱动和版本信息
Linux下查看网卡驱动和版本信息 查看网卡生产厂商和信号 查看基本信息:lspci 查看详细信息:lspci -vvv # 3个小写的v 查看网卡信息:lspci | grep Ethernet ...
- linux下看网卡版本,Linux下查看网卡驱动和版本信息
Linux下查看网卡驱动和版本信息 查看网卡生产厂商和信号 查看基本信息:lspci 查看详细信息:lspci -vvv # 3个小写的v 查看网卡 Linux下查看网卡驱动和版本信息 查看网卡生产厂 ...
- [转]Linux下显示硬件信息--lshw
Linux下显示硬件信息--lshw lshw lshw(Hardware Lister)是另外一个可以查看硬件信息的工具,不仅如此,它还可以用来做一些硬件的benchmark. 这个工具其实就是 ...
- Linux使用总结之 : Linux下查看网卡速率信息
Linux下查看网卡速率信息: 1.使用ethtool命令 ethtool ethx #查看支持的速率 ethx 为网卡名,使用 ifconfig -a ,ip a 查询.响应数据中: Link de ...
- 什么是 Linux 下的 platform 设备驱动
Linux下的字符设备驱动一般都比较简单,只是对IO进行简单的读写操作.但是I2C.SPI.LCD.USB等外设的驱动就比较复杂了,需要考虑到驱动的可重用性,以避免内核中存在大量重复代码,为此人们提出 ...
- Realtek 8852BE Think Book 14 + 在Arch Linux下安装网卡驱动
Realtek 8852BE Think Book 14 + 在Arch Linux下安装网卡驱动 原链接:https://gith删ub.com/lwfinger/rtw89 不要选择下图方法,在我 ...
- linux 有线网卡,linux下有线网卡出现ADDRCONF(NETDEV_UP): eth0: link is not ready的解决方法...
一.背景 2018年5月24日,笔者的pc已经连续运转两天了,突然要使用有线网卡,却发现有线网卡无法正常工作,于是查看了一下内核日志: r8169 0000:05:00.0 eth0: link do ...
最新文章
- PHP for循环中的sql语句,php – 在foreach循环中使用SQL结果
- 搞懂Kafka的这个问题,你离大厂就不远了!
- 【转载】3389远程终端常用CMD命令
- 【java】java工具类StringUtils,org.apache.commons.lang3.StringUtils
- 排列组合 概率 贝叶斯理解
- 【负载均衡】揭开F5 BIG-IP的神秘面纱(一)
- java修改JFrame默认字体
- java类加载器_类加载器ClassLoader
- Spring常问的面试
- 云炬创业政策学习笔记20210111
- 1063 Set Similarity
- java类验证和装载顺序_JVM类加载过程分析及验证
- 华为Mate40 RS保时捷设计推8+256GB版本:起售价便宜1000元
- jdbc mysql分层_JDBC和数据库访问层
- 定时锁定计算机怎么设置方法,电脑定时锁屏怎么设置
- Java多线程系列--【JUC集合07】- ArrayBlockingQueue
- 数字黑洞java,java解决数字黑洞问题
- 数据库-内外连接及左右连接的区别
- 淘宝api接口系列,获取sku详细信息
- MySQL课程设计——简易学生信息管理系统
热门文章
- fastmock模拟常见数据结构
- python实现k-shell复杂网络_企业网络结构复杂,如何高效、简单实现异地组网?...
- multipartfile获取文件路径_已知路径,通用获取文件名、后缀、类型
- 怎么用python语法1234_python 基本语法1
- postman post传输中文_Postman:Postman简介、安装、入门使用方法详细攻略
- Properties文件操作
- CMU 15-213 Introduction to Computer Systems学习笔记(7) Machine-Level Programming-Data
- java企业级开发规范_“华为云企业级Java编程规范”学习笔记
- 【系列三之CentOS系列】CentOS命令操作(1)
- SpringBoot以jar包部署需要注意的thymeleaf页面映射问题