mac check which localhost ports are in use code example Example: running ports in mac sudo lsof -PiTCP -sTCP:LISTEN