根据端口号查询进程并杀掉被占用的进程

查询进程:

lsof -i :8888

杀掉进程:

kill -9 PID

原文地址:https://www.cnblogs.com/princesong/p/9558885.html