Kill a process which is listening on port 8080

I perform the following on Win7 32-Bit in the command prompt:

netstat -ano | findstr 8080

it returns with:

TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 1896

how might I kill this process?

6 Answers

In windows you can use taskkill /pid 1896

See the reference at

4

If you are using Git BASH then you can try with below command

taskkill //pid 1896

Not the extra back slash here, otherwise it will throw error of invalid argument.

I hope it helps!!

I'm using Josep's command above in a script because we have a problem where MS werfault.exe (Dr Watson) steals port 8080 from our proxy server.

It's a great command, but the find "8080" will also find a port of e.g 18080 or a process id that has 8080 in it. Subsequently the wrong task could be killed.

Can be improved by changing the find string to ":8080 " (note the trailing space)

Thanks

1

Open command prompt and execute:

for /f "tokens=5" %a in ('netstat -aon ^| find ":8080" ^| find "LISTENING"') do taskkill /f /pid %a

If you want to do it in a .bat, replace %a for %%a

For me following works on windows 10, so you guys can also try !!

First of all, find all the process which are running ona port.

For that use following command in cmd:

 netstat -ano | findstr <port_number>

After finding all the process running on a port, just use below command to terminate the process you want to terminate :

 taskkill /F /pid 10608

10608 is the process which is going to be terminated.

1

in linux u can use for kill process permanently

kill -9 PID

ex. I am going to kill httpd process and httpd pid is 7452 ok. then

#kill -9 7452 

But make sure u can use this process only for linux .

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like