How do I Kill or Stop a Process Running on Particular Port in Linux?
This post will walk you through how do we Kill or stop the process of running with a port number in your Linux operating system. If you would like to stop an Apache or NGINX or Tomcat any one of the web server is running in your machine and would like to stop manually using the Shell command,
Here, will kill the port number 8080 which is using a Tomcat server, the command is,
kill -9 $(lsof -i:8080 -t)
or another option is,
fuser -k -n tcp 8080
- fuser - identify processes using files or sockets
- The -k or --kill => Kill processes accessing the file.
- The -n or --namespace => Select a different name space. by default selected the filename, we can choose the TCP or UDP local port