显示网卡发送发送的数据包流量

[root@libin5 shell]# vim shell2.sh

#!/bin/bash
# 使用死循环实时显示 ens160 网卡发送的数据包流量
while :
do
echo '本地网卡 ens160 流量信息如下: '
ifconfig ens160 | grep "RX pack" | awk '{print $5}'
ifconfig ens160 | grep "TX pack" | awk '{print $5}'
sleep 1
done

 

posted @ 2022-11-17 22:46  LB_运维技术  阅读(69)  评论(0编辑  收藏  举报