Skip to content

Instantly share code, notes, and snippets.

@khoa-le
Last active July 11, 2016 04:10
Show Gist options
  • Save khoa-le/0a11f8e20fa57d1ddee1 to your computer and use it in GitHub Desktop.
Save khoa-le/0a11f8e20fa57d1ddee1 to your computer and use it in GitHub Desktop.
Who is listening on a given TCP port on Mac OS X?
lsof -iTCP -i :port #To show all networking related to a given port:
lsof -i :22
lsof [email protected]
lsof -i| grep LISTEN
lsof -u daniel #username
lsof -p 10075 #pid
lsof +D /dir/ect/ory
lsof +d /dir/ect/ory #more simple view
lsof /file/name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment