This article is a mirror article of machine translation, please click here to jump to the original article.

View: 9403|Reply: 0

Window uses cmd to view the commands for port occupancy, corresponding processes, kill processes, etc

[Copy link]
Posted on 5/30/2016 10:14:06 AM | | |
Start-run--cmd Enter the command prompt Enter netstat -ano to see all connected PIDs, and then find the program corresponding to this PID in the task manager. If there is no PID item in the task manager, you can select "View" - "Select columns" in the task manager.

        Often, when we start the application, we find that the port needed by the system is occupied by other programs, how to know who occupies the port we need, many people have a headache, the following is a very simple method, I hope it will be useful to everyone

If we need to determine who occupies our port 9050

1. Windows platform
Execute under the Windows command line window:
1. View all port usage
C:\>netstat -ano
  Protocol Local Address External Address Status PID
  TCP    127.0.0.1:1434         0.0.0.0:0              LISTENING       3236
  TCP    127.0.0.1:5679         0.0.0.0:0              LISTENING       4168
  TCP    127.0.0.1:7438         0.0.0.0:0              LISTENING       4168
  TCP    127.0.0.1:8015         0.0.0.0:0              LISTENING       1456
  TCP    192.168.3.230:139      0.0.0.0:0              LISTENING       4
  TCP    192.168.3.230:1957     220.181.31.225:443     ESTABLISHED     3068
  TCP    192.168.3.230:2020     183.62.96.189:1522     ESTABLISHED     1456
  TCP    192.168.3.230:2927     117.79.91.18:80        ESTABLISHED     4732
  TCP    192.168.3.230:2929     117.79.91.18:80        ESTABLISHED     4732
  TCP    192.168.3.230:2930     117.79.91.18:80        ESTABLISHED     4732
  TCP    192.168.3.230:2931     117.79.91.18:80        ESTABLISHED     4732

2. Check the occupancy of the specified port
C:\>netstat -aon|findstr "9050"
  Protocol Local Address External Address Status PID
  TCP    127.0.0.1:9050         0.0.0.0:0              LISTENING       2016
P: See, the port is occupied by a process with process number 2016, continue to execute the following command: (You can also go to the task manager to check the process corresponding to the pid)
3. Check the process corresponding to the PID
C:\>tasklist|findstr "2016"
Image Name PID Session Name Session# Memory Usage
========================= ======== ================
  tor.exe                     2016 Console                 0     16,064 K

P: It's clear, Tor is taking up your port.

4. End the process
C:\>taskkill /f /t /im tor.exe





Previous:Let's also keep up with the pace of the times and try the win10 system!!
Next:QQ brush online music duration principle
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com