veer7 veer7 - 1 year ago 201
Linux Question

How to kill a process running on particular port in Linux?


tried to close the tomcat
from tomcat
directory. But found that the server was not closed properly. And thus I was unable to restart
My tomcat is running on port

I want to kill the tomcat process running on
. I first want to have the list of processes running on a specific port (8080) in order to select which process to kill.

Answer Source

Use the command

 netstat -plten |grep java

used grep java as tomcat uses java as their processes.

It will show the list of processes with port number and process id

tcp6       0      0 :::8080                 :::*                    LISTEN      
1000       30070621    16085/java

the number before /java is a process id. Now use kill command to kill the process

kill -9 16085

-9 implies the process will be killed forcefully.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download