参考博客

查看特定端口的占用情况

使用lsof命令

查询8080端口占用情况

lsof -i :8080

使用netstat命令

netstat -anp tcp -v | grep 

终止占用端口的进程

例如:pid=1234

kill 1234