List current active connections on Mac OSX

Posted on

This is a handy little terminal script I've used a lot recently which lists the current active connections on OSX. It's really handy for seeing if Apache / Node.js / Ruby stuff is running on ports correctly.

lsof -i | grep -E "(LISTEN|ESTABLISHED)" 

This was written by Mike Rogers, a freelance Ruby on Rails developer based in London.

Share the ♥ by sharing this!

If you want to discuss this post, feel free to tweet me (@MikeRogers0) or drop me an email. Any code samples unless stated otherwise are licensed under the The MIT License (MIT). Spotted a mistake? Send me a pull request :)