【文件属性】:
文件名称:实时查看系统流量的Shell脚本分享
文件大小:21KB
文件格式:PDF
更新时间:2021-01-20 16:02:33
rx shell shell脚本
代码如下:
#!/bin/bash
while [ “1” ]
do
eth=$1
RXpre=$(cat /proc/net/dev | grep $eth | tr : ” ” | awk ‘{print $2}’)
TXpre=$(cat /proc/net/dev | grep $eth | tr : ” ” | awk ‘{print $10}’)
sleep 1
RXnext=$(cat /proc/net/dev | grep $eth | tr : ” ” | awk ‘{print $2}’)
TXnext=$(cat /proc/net/de