linux / windows resolve / close the port occupancy

Linux

Port occupied process information to find:

netstat -lnp|grep 端口号 
例如:netstat -lnp|grep 8080 就是找到正在使用8080端口的进程

Close process:

kill -9 进程PID
例如:kill -9 6666 就是杀死进程PID为6666的进程

Windows

Port occupied process information to find:

netstat -nao | findstr "端口号"
例如:netstat -nao | findstr "8080" 就是找到正在使用8080端口的进程

Close process:

taskkill /pid 进程PID /F
例如:taskkill /pid 6666 /F 关闭PID为6666的进程

Guess you like

Origin www.cnblogs.com/MPengYu/p/12643847.html