Linux Administration Cookbook
上QQ阅读APP看书,第一时间看更新

There's more...

iftop offers a lot of options, and a peruse of the manual page is worth considering. Simple things like using -n to disable hostname lookups can be handy, or changing how the bandwidth rates are displayed.

You can even print a text-only version to stdout using the -t flag:

$ sudo iftop -i eth1 -t
interface: eth1
IP address is: 192.168.33.11
MAC address is: 08:00:27:f1:e9:56
Listening on eth1
# Host name (port/service if enabled) last 2s last 10s last 40s cumulative
--------------------------------------------------------------------------------------------
1 centos2 => 35.7Kb 35.7Kb 35.7Kb 8.91KB
192.168.33.10 <= 416b 416b 416b 104B
--------------------------------------------------------------------------------------------
Total send rate: 35.7Kb 35.7Kb 35.7Kb
Total receive rate: 416b 416b 416b
Total send and receive rate: 36.1Kb 36.1Kb 36.1Kb
--------------------------------------------------------------------------------------------
Peak rate (sent/received/total): 35.7Kb 416b 36.1Kb
Cumulative (sent/received/total): 8.91KB 104B 9.02KB
=============================================================================================