Sunday, November 24, 2013

See Bandwidth Usage Per Process Via Terminal with 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. If there's suddenly a lot of network traffic, you can fire up NetHogs and immediately see which PID is causing this. This makes it easy to indentify programs that have gone wild and are suddenly taking up your bandwidth.


Install nethogs under Debian or Ubuntu Linux

$ sudo apt-get install nethogs


How use nethogs?

The syntax is:

nethogs
nethogs eth1
nethogs [option] eth0 eth1
nethogs [option] eth0 eth1
ppp0 sudo /usr/sbin/nethogs eth0

in this cases i'm use wlan0 so the syntax is:

sudo nethogs wlan0


Sample Outputs:








Other Nethogs option :
-d : delay for update refresh rate in seconds. default is 1.
-t  : tracemode.
-b : bughunt mode - implies tracemode.
-p : sniff in promiscious mode (not recommended).
device : device(s) to monitor. default is eth0

Syntax When nethogs is running, press:

q : quit
m : switch between total and kb/s mode


Nethogs Web : http://nethogs.sourceforge.net/