Using GeekTool and lsof, you can display an automatically updated list of open network connections directly on a Mac OS X desktop. This is tip is a “safe” alternative to the previously mentioned open_ports utility.
The problem with installing and using open_ports is that it is a third party script running as root, and for many users that is unacceptable. Here is a method that is native to Mac OS X and doesn’t even require root access to watch network connections:
First, if you want to discard the GeekTool portion and just get a quick look at open connections, you can quickly list all open network connections with:
lsof -i | grep -E “(LISTEN|ESTABLISHED)”
lsof -i
You could also combine this with the ‘watch’ utility and just keep an eye on open connections in a terminal window.
