shutdown a port mac code example Example 1: kill port in mac terminal sudo lsof -i :5955 Example 2: how to stop a port in macos kill -9 port