Linux流量监控的三个方式

Linux流量监控的三个方式
复制#!/bin/bash    echo -n "which nic?流量监"    read eth    echo "the nic is "$eth    echo -n "how much seconds:"    read sec    echo "duration is "$sec" seconds, wait please..."    infirst=$(awk /$eth/{print $1 } /proc/net/dev |sed s/$eth://)    outfirst=$(awk /$eth/{print $10 } /proc/net/dev)    sumfirst=$(($infirst+$outfirst))    sleep $sec"s"    inend=$(awk /$eth/{print $1 } /proc/net/dev |sed s/$eth://)    outend=$(awk /$eth/{print $10 } /proc/net/dev)    sumend=$(($inend+$outend))    sum=$(($sumend-$sumfirst))    echo $sec" seconds total :"$sum"bytes"    aver=$(($sum/$sec))    echo "avrage :"$aver"bytes/sec"   1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.
人工智能
上一篇:联想小新510si7(轻薄便携,细节出色,高效办公娱乐利器)
下一篇:新电脑到手硬盘检测错误的全面解决方案(确保您的新电脑硬盘正常运行,避免数据丢失和系统崩溃)