Current location - Quotes Website - Team slogan - How to check whether the port is open and occupied?
How to check whether the port is open and occupied?
Tools/raw materials

computer

The method/steps are as follows:

1, start-> run -> Cmd, or press window+R to bring up the command window.

2. Enter the command: netstat -ano lists all ports. Observe the occupied ports in the list, such as 49 157.

3. Check the PID corresponding to the occupied port, enter the command: netstat-aon | findstr "49157", press enter, and write down the last digit, namely PID, here is 2720.

4. Continue to enter tasklist | findstr "2720" and press enter to see which process or program occupies port 2720. The result: svchost.exe.

5. Or, open the task manager, switch to the process tab, and see who the process corresponding to 2720 is in the PID column. If the PID column is not visible, please refer to the following figure:

6. click view-> select a column, check the box in front of PID (process identifier), and click ok.

7. In this way, you can see the column ID of PID and who is the corresponding process of 2720. If not, you can see that the image name is svchost.exe and the description is the main process of Windows, which is exactly the same as the above command.

8. End process: select a process in the task manager and click the "End Process" button, or enter: taskkill/f/t/im Tencentdl.exe in the cmd command window.