Mac free all ports code example Example 1: killing a port mac sudo lsof -i :3000 Example 2: running ports in mac sudo lsof -PiTCP -sTCP:LISTEN