how to enable the port in the network mac code example Example 1: running ports in mac sudo lsof -PiTCP -sTCP:LISTEN Example 2: how to stop a port in macos kill -9 port