Processes network usage

dani++

usin UNIX since '92
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++
 
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.
 
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)
System 393 eric 7u inet 0x02be577c 0t0 TCP localhost:49152->localhost:1033 (ESTABLISHED)
LaunchCFM 485 eric 23u inet 0x02be5f8c 0t0 TCP *:3761 (LISTEN)
LaunchCFM 485 eric 24u inet 0x02b20a40 0t0 UDP *:2222
LaunchCFM 485 eric 35u inet 0x02be5a2c 0t0 TCP omppu:49646->fake.name.com:imap (ESTABLISHED)

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
 
Back
Top