服务器上放着3个tomcat,通过top或者ps -aux | grep 来找对应的进程名,然后再kill掉,感觉都比较麻烦
弄来弄过还是觉得
lsof的-i参数挺有用的
Multiple addresses (up to a limit of 100) may be specified with multiple -i options.
(A port number or service name range is counted as one address.)
They are joined in a single ORed set before participating in AND option selection.
直接查看某个端口的进程,例如:80端口
- lsof -i :80
lsof -i :80
直接可以查看80端口占用的进程号