linux上網路相關的幾個命令
根據目的不同,可以按以下幾種分類。
- 監控總體頻寬使用――nload、bmon、slurm、bwm-ng、cbm、speedometer和netload
- 監控總體頻寬使用(批量式輸出)――vnstat、ifstat、dstat和collectl
- 每個套接字連線的頻寬使用――iftop、iptraf、tcptrack、pktstat、netwatch和trafshow
- 每個程序的頻寬使用――nethogs
1.nload
yum install nload
實時上行下行頻寬大小。
Device eth0 [172.21.208.166] (1/2):
===================================================================================================================================================================
Incoming:
Curr: 1.26 kBit/s
Avg: 2.52 kBit/s
Min: 424.00 Bit/s
Max: 12.26 kBit/s
Ttl: 5.62 GByte
Outgoing:
Curr: 10.73 kBit/s
Avg: 16.23 kBit/s
Min: 5.33 kBit/s
Max: 59.06 kBit/s
Ttl: 6.17 GByte
2. nethogs 檢測某個程序頻寬佔用情況
yum install nethogs
3.iftop 檢測通過每一個套接字連線傳輸的資料
yum install iftop
iftop -n -i eth1