Is there any way to view which applications are accessing the Internet on Mac OS X?

I think I remember a command line utility that did this, but I can't remember what it's called and a few Google searches turn up nothing.


sudo lsof -i -P | grep -i "listen"  

from List open ports on your machine (Mac OS X).

It was the second google result for "list sockets mac osx"

You could grep tcp or udp instead to get outbound ports instead of listening ports.


The easy way is to use Little Snitch, but it's not free (although there is a trial version).