012_使用死循环实时显示 eth0 网卡发送的数据包流量

#!/bin/bash

while :

do

echo '本地网卡 eth0 流量信息如下: '

#grep输出所找整行,awk直接输出第5

    ifconfig eth0 | grep "RX pack" | awk '{print $5}'

    ifconfig eth0 | grep "TX pack" | awk '{print $5}'

    sleep 1

done

猜你喜欢

转载自www.cnblogs.com/luwei0915/p/10514426.html