close open port mac code example Example 1: how to close a port mac sudo lsof -i :5955 Example 2: release a port in mac sudo lsof -i :<port>