Get the App
SLTechnology News&Howtos  ›  Servers  › 

Processing port is occupied

Shulou Source: shulou.com Published: 2022-06-02 07:36:42 10月04日 Update

Often, when we start the application, we find that the port needed by the system is occupied by other programs. How to know who owns the port we need? many people have a headache. Here is a very simple method. I hope it will be useful to you.

If we need to determine who occupies our port 9050,

1. Windows platform

Execute under the windows command line window:

1. Check all port occupancy

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

two。 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 the process with process number 2016. Continue to execute the following command: (you can also check the process corresponding to pid in the task manager)

3. View the process corresponding to PID

C:\ > tasklist | findstr "2016"

Image name PID session name session # memory usage

=

Tor.exe 2016 Console 0 16064 K

P: it's clear that tor is occupying your port.

4. End the process

C:\ > taskkill / f / t / im tor.exe

Tags: Port process address command situation status headache clarity task memory name platform method time image useful program system application management Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology MySQL Microsoft NVidia Shulou Information