How to Find and Kill a Process that is Using a Particular Port

I had a problem with tomcat, it says that port 8080 is already in use so I can not use it …
What I did ?

1- Find what application/process is using the pro, type:

----------------------------------------------------------------------------------------------------
sudo netstat -lpn | grep :8080
----------------------------------------------------------------------------------------------------

You will get an output similar to this one
tcp6       0      0 :::8080                 :::*                    LISTEN      6782/java

2- I have got the process Id, which is 1234, now this is the process that is using port 8080.

3- Kill the process, type:
----------------------------------------------------------------------------------------------------------------------------------------
kill 6782
-------------------------------------------------------------------------------------------------

No comments:

Post a Comment

Start and Stop ssh-agent

Below is the bash script used to start and stop ss-agent #!/bin/bash ## in .bash_profile SSHAGENT=`which ssh-agent` SSHAGENTARGS="...