Find ports in use on macOS

Posted on Mon 16 September 2019 in programming • Tagged with macos, shell

How to find ports that are already "in use" on macOS:

sudo lsof -P -i TCP -s TCP:LISTEN

This is helpful if you are trying to figure out which process is using a port so that you can kill that process — for example, if you have a web server …


Continue reading