冒號後面就是你須要查看的端口號。前端
TheEternityZhang-MacBook:project zhtony$ sudo lsof -i :8080 Password: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME java 27374 zhtony 221u IPv6 0x3a877ef28e41f1b3 0t0 TCP *:http-alt (LISTEN) TheEternityZhang-MacBook:project zhtony$ kill -9 27374
有一個表頭名爲PID的一列,這一列就表示佔用當前端口的進程。java
sudo kill -9 27374