Monday, August 04, 2014

Listening Ports

Here's a handy command to find out which ports are listening:

/usr/sbin/lsof -P | sed -e '/(LISTEN)/ ! d; s/.* TCP .*:\([0-9][0-9]*\) .*/\1/' | sort -n | uniq

And ymmv, but sudo is probably a good way to run that.

No comments: