Display a List of Open Network Connections on the Mac OS X Desktop

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)"
You could also combine this with the ‘watch’ utility and just keep an eye on open connections in a terminal window.
That portion of the tip has been covered here before regarding lsof, but the next part is geared specifically for GeekTool because it allows a constantly refreshed list of active connections to overlay against your desktop background picture.
Read more »
















