I am trying to kill a proccess in the command line for a specific port in ubuntu.
If I run this command I get the port:
sudo lsof -t -i:9001
so...now I want to run:
sudo kill 'sudo lsof -t -i:9001'
I get this error message:
ERROR: garbage process ID "lsof -t -i:9001".
Usage:
kill pid ... Send SIGTERM to every process listed.
kill signal pid ... Send a signal to every process listed.
kill -s signal pid ... Send a signal to every process listed.
kill -l List all signal names.
kill -L List all signal names in a nice table.
kill -l signal Convert between signal numbers and names.
I tried sudo kill 'lsof -t -i:9001'
as well
Use this for killing process which is running on port number "9001"
To kill on port service in ubuntu, Enter the below command in terminal
In Terminal :
The best way to kill a port in ubuntu terminal is
fuser -k 9001/tcp
you can use
see more details in wikipedia
sudo kill $(sudo lsof -t -i:1337)
FOR UBUNTU 1- Find what application/process is using the pro, type:
and press Enter.
You will get an output similar to this one
2- I have got the process Id, which is 6782, now this is the process that is using port 8080.
3- Kill the process, type:kill 6782