Use the command "sudo lsof -iTCP -sTCP:LISTEN -P | grep :".