iterm mac end running ports code example Example 1: kill port in mac terminal sudo lsof -i :5955 Example 2: release a port in mac sudo lsof -i :