lsof -i tcp:<port>

works on both mac&linux

sudo netstat -nlp

^^ wont work under macos