Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Fedora 13 64bit. My eclipse program starts a server on port 9050 but I shutdown the program, eclipse fails to properly shutdown the server. Restarting eclipse has no effect.

How can I close or unbind a port forcibly from command line?

I know rebooting or log off and back on will clear the ports but this much slower process for me. I am looking for forcibly closing the port in command line.

share|improve this question
up vote 2 down vote accepted

The only way to forcefully close a listening port is to kill the process that is listening on it. Use lsof, netstat, fuser – as root – to find out the process ID. Once the process exits (by itself or by being killed), the kernel will automatically clean up all sockets it had open. (However, there might be cases that programs will be denied listening on the same port for a few minutes; in this case all you can do is wait.)

share|improve this answer
lsof -n -i

Find the process you're looking for and kill it.

Same answer to this question I think.

share|improve this answer
Throw on | grep ":9050" (or whatever port number) to easily filter the output – ParrotMac Jun 10 '14 at 0:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.