window/linux 查看端口占用进程并杀掉

windows:

查看端口占用(获得进程ID)

netstat -aon|findstr "31581"

查看任务端口(获得进程名称)

tasklist|findstr "4504"

结束任务

taskkill /f /t /im javaw.exe

linux:

netstat -tunlp|grep 18191

ps -ef|grep 23049

kill -9 tomcat

猜你喜欢

转载自bugyun.iteye.com/blog/2341947