Created
April 21, 2010 17:24
-
-
Save defunkt/374130 to your computer and use it in GitHub Desktop.
List what ports are in use on OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List what ports are in use on OS X | |
sudo lsof -iTCP -sTCP:LISTEN -P |
Wow, sudo lsof -iTCP -sTCP:LISTEN -P
is alot faster and works great.
@kennethreitz: that's why I posted it - doing the filtering in lsof rather than on its output can be enormously faster (particularly if you use the host/port filtering syntax - e.g. sudo lsof -iTCP:80 -sTCP:LISTEN -P
for HTTP) and I've tended to encounter that in situations where it really mattered on busy servers.
I've long been a fan of sudo netstat -tunlp
, but I don't know if all of those options are cross-platform or Linux only.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@priteau FTW!