I am trying to kill a process in the command line for a specific port in ubuntu.
If I run this command I get the port:
sudo lsof -t -i:9001
>
There are some process which does not shown using normal netstat command, so you have to check it using sudo
.
Do sudo netstat -lpn |grep :8080
. Process running by system does not show PID, to get PID of this process you will have to run it using sudo
And then killl the process using port 8080
. You may have to use sudo
here as well. So to kill this process use sudo kill -9 PID