Linux下查看端口进程,并且批量kill
lsof -t -iTCP:${port} # 查看该端口的进程
kill -9 `lsof -t -iTCP:${port}` # 杀死该端口下所有的进程
参考链接:
https://stackoverflow.com/questions/33101725/how-to-combine-lsof-i-port-and-kill-pid-in-bash
lsof -t -iTCP:${port} # 查看该端口的进程
kill -9 `lsof -t -iTCP:${port}` # 杀死该端口下所有的进程
参考链接:
https://stackoverflow.com/questions/33101725/how-to-combine-lsof-i-port-and-kill-pid-in-bash