List processes listening on TCP ports on Mac OS X using lsof
Posted: April 14, 2010 | Author: Kyle Crawford | Filed under: Mac OS X Server, Mac OS X, Scripting, Unix | Tags: Mac OS X Server, Mac OS X, lsof, netstat, listen, ports, processes | 1 Comment »lsof -i | grep LISTEN | grep "TCP \*:" | sort
Or to find out what processes have open connections use
lsof -i | grep ESTABLISHED | sort
Nothing ground breaking, but useful. netstat gives you similar info, but doesn’t include the process.