linux 使用ifstat查看網絡使用情況


首先安裝ifstat

wget http://distfiles.macports.org/ifstat/ifstat-1.1.tar.gz
tar xzvf ifstat-1.1.tar.gz
cd ifstat-1.1
./configure
make
sudo make install

然后查看

#ifstat
  eth0       
 KB/s in  KB/s out
   12.64   1481.41
    0.00      0.00
   10.91   1459.28
    0.00      0.00
   15.71   1300.80
    0.00      0.00
   13.89   1615.13
    0.00      0.00
    9.53    696.94
    0.00      0.00
   12.72   1200.90

默認ifstat不監控回環接口,顯示的流量單位是KB。

如果查看所有端口:

ifstat -a
        lo                 eth0                eth1       
 KB/s in  KB/s out   KB/s in  KB/s out   KB/s in  KB/s out
    0.08      0.08      0.00      0.00      0.00      0.00
    0.18      0.18     18.25   1286.86      0.00      0.00
    0.07      0.07      0.00      0.00      0.00      0.00
    0.07      0.07     17.33   1124.82      0.00      0.00
    0.07      0.07      0.00      0.00      0.00      0.00
    0.07      0.07     21.65   1149.00      0.00      0.00
    0.07      0.07      0.00      0.00      0.00      0.00
    0.17      0.17     19.84   1138.90      0.00      0.00
    0.25      0.25      0.00      0.00      0.00      0.00
    0.07      0.07     19.27   1630.61      0.00      0.00
    0.07      0.07      0.00      0.00      0.00      0.00

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM