Kill a process running on a specific port on macOS

Published on June 21st, 2023

  1. lsof -i tcp:<port> - to get the PID by <port>.
  2. kill -9 <PID> - to kill by <PID>.