我正在编写一个脚本来打印 ifconfig 的 ethtool 详细信息。
示例输出应该来自 ifconfig 之类的,
eth0
eth1
eth2
我试过使用下面的命令,
root@bt# ifconfig | cut -d ":" -f 1
但无法达到同样的效果。
实际上,我需要获取这些eth*
并传入
root@bt# ethtool <arg1> where arg1=eth*
为了获得结果 :-) 你能帮我从 ifconfig 中获取裁剪吗? ?
最佳答案
没有。
$ awk -F: '$1 ~ "eth" { print $1 }' /proc/net/dev
eth0
关于linux - 如何削减 ifconfig 以单独获取 eth* 详细信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12664473/