Windows and Linux system ports are occupied

1. Windows system

1. Check the pid according to the occupied port

Enter cmd to enter the command window

Enter the command (9257 here is the occupied port number)

netstat -ano | findstr 9257

 2. Kill the process by pid

Enter the command (here 22228 is the corresponding pid)

taskkill /f /pid 22228

 2. Linux system 

1. Enter the netstat -tln | grep+occupied port command in the terminal window. For example: 

netstat -tln | grep 9202

2. Enter the lsof -i:+occupied port command, and press Enter to check which process the port is occupied by.

lsof -i:9202

3. Enter the kill -9+process id command, and press Enter to kill the process that occupies the port.

 

kill -9 14584

Guess you like

Origin blog.csdn.net/yy12345_6_/article/details/128099878