# Processes network usage



## dani++ (Jun 13, 2002)

Does anyone know of a flag to tell netstat or some other program to get what processes are using the network and their activity?

My network usage monitor is showing download activity all the time and I do not know what is causing it.

Thanks in advance.

dani++


----------



## BSDimwit (Jun 13, 2002)

type netstat -n | grep ESTABLISHED and that will show you all the established connections your machine has at the moment.  From the port number its using you can probably discern which program is using your network.


----------



## lurk (Jun 24, 2002)

Howdy,

If the specific process using the network is of interest you want to run *lsof -i*  to list all of the currently open internet connections.  On my box this currently yields


> [omppu:~] eric% lsof -i
> COMMAND   PID USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
> loginwind 246 eric    4u  inet 0x02be6a4c      0t0  TCP localhost:847->localhost:1033 (ESTABLISHED)
> XDarwin   304 eric    0u  inet 0x02be54cc      0t0  TCP *:6000 (LISTEN)
> ...



_The above was edited to protect the names of the innocent_

Lsof is really a cool program which can do lots of stuff looking at its man page is a bit of a chore but is rewarding.  I have used it jillians of times to get that little bit of hidden info out of the box.

-Eric


----------

