1. Windows platform
Start → run →cmd into the command prompt, enter Netstat-ano to see all the connected PID in the task Manager to find the corresponding PID program if there is no PID in Task Manager, you can select "View"-"Choose Column" in Task Manager
The code is as follows |
Copy Code |
C:>netstat-aon|findstr "80"
TCP 127.0.0.1:80 0.0.0.0:0 Listening 2016 |
Do you see that the port is occupied by a process number 2016 process, and continue with the following command:
The code is as follows |
Copy Code |
C:>tasklist|findstr "2016" Tor.exe 2016 Console 0 16,064 K |
It's clear that Tor is taking up your port.
2, Linux
Today found the server on the Tomcat 8080 port does not come up, the old hint port has been occupied.
To use the command:
The code is as follows |
Copy Code |
Ps-aux | grep Tomcat |
Found no 8080-port Tomcat process.
Using commands: NETSTAT–APN
View all process and port usage. Found the following list of processes, where the last column is Pid/program name
The 8080 port was found to be occupied by the PID 9658 Java process.
Further use of the command: Ps-aux | grep Java, or directly: Ps-aux | grep PID View
You can know exactly which program the 8080 port is occupied by! Then decide whether to use KILL command to kill!
Method Two: Direct use
code is as follows |
copy code |
netstat -anp | grep PortNo that is: NETSTAT–APN | grep 8080 |