DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Nic has posted 15 posts at DZone. View Full User Profile

Find Ports Used By Applications On Mac OS X (i.e. Netstat For Os X)

06.29.2008
| 32671 views |
  • submit to reddit
        
netstat
 on os x doesn't do what you hope it does - show port numbers for applications.

Here's a snippet for your .bash_profile:

# replacement netstat cmd to find ports used by apps on OS X
alias netstat_osx="sudo lsof -i -P"

(thx Lachie Cox)