netstat find port 80 on macos code example Example: netstat listening port 8080 mac lsof -nP -iTCP:$PORT | grep LISTEN