List open ports on OS X

If you are used to Linux, you might have been used to the following command

netstat -atp | grep -i "listen"

In OS X netstat doesn’t work in the exact same way, and you can use the lsof command.

A simple way of listing your open and listening ports in OS X

sudo lsof -i -P | grep -i "listen"

Leave a Reply

Your email address will not be published. Required fields are marked *