Find (and kill) process locking port 9000 on Mac

  1. You can try netstat

    netstat -vanp tcp | grep 9000
    
  2. For macOS El Capitan and newer (or if your netstat doesn't support -p), use lsof

    lsof -i tcp:9000
    sudo lsof -i :9000
    
  3. Kill:

    kill -9 <PID>
    

PLEASE NOTE: -9 kills the process immediately, and gives it no chance of cleaning up after itself. This may cause problems. Consider using -15 (TERM) or -3 (QUIT) for a softer termination which allows the process to clean up after itself.

posted @ 2023-04-02 15:01  RioTian  阅读(287)  评论(0编辑  收藏  举报