Posted on :: Tags: , , , , ,

Sometimes I need to find out which process is listening on a specific port, usually so I can kill it.

On macOS:

sudo lsof -i -P | grep LISTEN | grep :$PORT

And on Linux:

netstat -pntl | grep $PORT