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.

Thanks, Boaz

link|improve this question

78% accept rate
feedback

6 Answers

up vote 5 down vote accepted

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.

link|improve this answer
feedback

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 :

alt text

  • 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 :

alt text

link|improve this answer
feedback

On top of what pQd has mentioned, one of my favourites is pktstat instead. I often used that.

link|improve this answer
feedback

My favorite so far is ifstatus. It is curses based so it works in a terminal and it gives a graph of your traffic history over time (fully configurable).

link|improve this answer
feedback

ntop might be what you are looking for.

link|improve this answer
feedback

List open conncetions

lsof -i :80

List all services called httpd

lsof -i -nP | grep httpd
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.