Skip to content
Fix Code Error

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

March 13, 2021 by Code Error
Posted By: Anonymous

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

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

Solution

Use the command

 sudo 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.

Answered By: Anonymous

Related Articles

  • Eclipse will not start and I haven't changed anything
  • Launching Spring application Address already in use
  • How to install the Raspberry Pi cross compiler on my Linux…
  • Unable to create/open lock file: /data/mongod.lock errno:13…
  • How do I shutdown, restart, or log off Windows via a bat…
  • How do SO_REUSEADDR and SO_REUSEPORT differ?
  • Mongod complains that there is no /data/db folder
  • Assign category or integer to row if value within an…
  • stop all instances of node.js server
  • Reference - What does this regex mean?

Disclaimer: This content is shared under creative common license cc-by-sa 3.0. It is generated from StackExchange Website Network.

Post navigation

Previous Post:

Set the value of an input field

Next Post:

How do you display code snippets in MS Word preserving format and syntax highlighting?

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Get code errors & solutions at akashmittal.com
© 2022 Fix Code Error