Problem :
I want to do something like this:
time my_application
But instead of time
I want some utility that will measure the network traffic:
<some_network_tool> my_application
It should give some stats after my_application
quits. I’m only interested in volumes (Kb, Mb, Gb) and not in contents.
Is there such an utility?
Solution :
NetHogs
NetHogs is a small ‘net top’ tool. Instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwidth by process. NetHogs does not rely on a special kernel module to be loaded.
Fortunaltely, You have bunch of choices to do that, if you want:
- Overall bandwidth – nload, bmon, slurm, bwm-ng, cbm, speedometer, netload
- Overall bandwidth (batch style output) – vnstat, ifstat, dstat, collectl
- Bandwidth per socket connection – iftop, iptraf, tcptrack, pktstat, netwatch, trafshow
- Bandwidth per process – nethogs
source: http://www.binarytides.com/linux-commands-monitor-network/