The following article mainly takes the 80 port number as an example, if you want to know the other port number can also use the method
1, how to view the 80 port occupancy under Windows? What process is used? How to terminate and so on.
The main use of the DOS tool under Windows, click "Start"-"Run", enter "cmd" and click the OK button to enter the DOS window, then run the following command:
>netstat-aon | findstr "
Proto Local address Foreign address state PID
= = ============ ============== ========== ======
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 1688
can see that port 80 is occupied by a program with process number 1688.
>tasklist | findstr "1688"
Image name PID session name Session # Memory Usage
========================= ====== ================ ======== ============
Inetinfo.exe 1688 Console 0 2,800 K
It is obvious that inetinfo occupies 80 ports; Inetinfo.exe is primarily used to support the debugging of Microsoft Windows IIS Network Services. This program is very important to the normal operation of your system.
Of course, not only the Inetinfo.exe process will take up 80 ports, this is only the case on my machine. If you don't know what this process is for, do not blindly kill it, preferably Baidu or Google search, of course, if you know it well, and determine that it can be terminated, then proceed to the following command.
>taskkill/pid 1688/f
succeeded: The process with PID 1688 has been terminated.
If you are familiar with this process and are sure that it can be terminated, then use the command above to terminate the process with PID 1688 directly. (This step can also be done in Task Manager, Inetinfo.exe is the image name in the Task Manager, select it, click "End Process")
>tasklist | findstr "1688"
confirms the successful termination and should return NULL if the execution of this command is successfully terminated.
2. How to view 80 port occupancy under Linux? What process is used? How to terminate and so on
Query port is occupied, which process is occupied in two ways: 1, netstat-anl | grep "80"; 2, lsof-i:80
How to terminate a process: Kill PID