How to check the occupied port and close it

  There is a command like this in windows

  1) netstat -ano to view all processes occupying ports in the operating system

       eg: netstat -ano | findstr " 8081 " to get the process that occupies port 8081

      The latter is the binding IP and port, and the last column is the occupied process number (pid)

  

  2)taskkill /pid 123

    We can close the process whose process number is 123. Of course, when I tried the above command, the system prompts that the process cannot be terminated, then we can add a /F, as follows, to forcibly close it.

taskkill /F /pid 123

 

  3) Screenshot of the machine running:

  

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326159209&siteId=291194637