Port kill in localhost - DH-Learning/MyWiki GitHub Wiki
- Open Command Prompt as Administrator.
- Run the following command:
netstat -aon | findstr :<PORT>
Replace with the port number you're checking.
If the port is in use, you’ll see output like:
TCP 127.0.0.1:8080 0.0.0.0:0 LISTENING 1234
-
127.0.0.1:8080 – Port is bound to localhost
-
1234 – PID (Process ID)
-
To identify the process using that PID:
tasklist /FI "PID eq 1234"
-
Kill the Process
taskkill /PID 1234 /F
-
Replace 1234 with your actual PID.
-
The /F flag forces termination.