MAC OS查看端口占用情况及杀死进程
因为运行web项目的时候,eclipse提示8080端口被占用,需要清除端口占用
终端命令
sudo lsof -i :pid
sudo lsof -i :8080
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
QQBrowser 26245 shudi 69u IPv4 0x9f01e7583f9b5adf 0t0 TCP 192.168.0.103:61179->14.17.42.49:http-alt (ESTABLISHED)
QQBrowser 26245 shudi 107u IPv4 0x9f01e7583f9b5adf 0t0 TCP 192.168.0.103:61179->14.17.42.49:http-alt (ESTABLISHED)
java 30298 shudi 46u IPv6 0x9f01e75830030157 0t0 TCP *:http-alt (LISTEN)
然后根据PID杀进程:
sudo kill -9 pid
sudo kill -9 30298