8

I'm doing in Ubuntu 12

alex@ubuntu:~/folder$ lsof -t -i:3000
4469
alex@ubuntu:~/folder$ kill 4469
alex@ubuntu:~/folder$ lsof -t -i:3000
4469

What did I do wrong?

2
  • Welcome to AskUbuntu! You may want to specify Ubuntu 12.04 or 12.10.
    – Oyibo
    Oct 31, 2012 at 8:52
  • What is process 4469? Do you have permission to kill it? (try sudo kill 4469). Does that process respond to the signal sent to it? (try sudo kill -9 4469, as signal 9 is required to be acted upon.)
    – Huckle
    Oct 31, 2012 at 19:25

4 Answers 4

26
kill -9 4469 

or

 fuser -k -n tcp 3000

3000 is the port number

or Use killport command :

wget https://raw.github.com/abdennour/miscs.sh/master/killport
killport 3000 
2

I know this is old, but I found this useful to me as well. Combining the lsof command from your question and the kill-9 from Abdennour TOUMI's answer into a much simpler and quicker one-line command would give the following:

kill -9 `lsof -t i:3000`

Inside of the two bactick (`) keys, you have the lsof -t i:3000 command from before, which gets the process on the port 3000. Then, the kill -9 command kills that process.

1

Use this command. Replace 8000 with any other port that you want to free up.

sudo fuser -k 8000/tcp
0

Try these two commands.

sudo lsof -i -P -n | grep LISTEN

This command will list down Which process is listening on which port. (Replace your port number "10050" with port which you are going to kill.)

sudo fuser -k 10050/tcp

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .