What is a simple & common command line tool to show network usage on a Linux machine? [closed]
I'm looking for a simple command line linux tool that will show me the current network usage, the same way top displays CPU usage.
What is the most standard tool (I can't install new things on the server) that will do the task. I don't need anything fancy and a simple text based tool will do.
i like ifstat:
brzoza:~# ifstat -b 1
eth0 eth1 eth2
Kbps in Kbps out Kbps in Kbps out Kbps in Kbps out
7870.11 27165.49 24776.69 7626.12 0.00 0.00
8738.48 27760.18 26787.02 7851.60 0.00 0.00
8532.13 28028.55 26122.37 7850.08 0.00 0.00
9029.12 25981.44 23108.86 8282.37 0.00 0.00
but there is much more - iptraf, iftop, nload just to name the few.
if you cannot really install / compile anything new - you'll have to write simple script parsing the output of ifconfig and calculating incements for input/output counters. two examples i've found: here and here.
Here are two tools that are worth checking out, although they are probably not available by default on your distribution :
- nethogs : a simple tool that will display the network usage by process :
(source: sourceforge.net)
- tcptrack is also very good, especially on a gateway - you can get the bandwidth used by any IP adress coming in or out your server :
(source: steve at www.rhythm.cx)
On top of what pQd has mentioned, one of my favourites is pktstat
instead. I often used that.