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
Try this:
lsof -i :port
or
sudo kill $(sudo lsof -t -i:8000)
or
kill -9 <pid>
or
sh killport 8000
The best way to kill a port in ubuntu terminal is
fuser -k 9001/tcp
Its two steps process:
Kill process of that id 8689 (can be different)
fuser -n tcp 8080
#o/p 8080/tcp 8689
kill -9 8689