kill server port mac code example Example 1: release a port in mac sudo lsof -i :<port> Example 2: killing a port mac kill -9 <PID>