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
>
Displays active TCP connections, ports on which the computer is listening.
netstat -tupln
It will list you all the connection along pid. Find and copy the pid and run the following command. Make sure you replace the with actual id in the following command.
kill -9
-9 use to forcefully kill the connection.