netstat osx how to know which app for 80 port code example Example: netstat listening port 8080 mac lsof -nP -iTCP:$PORT | grep LISTEN