How to kill a process hanging on a port

Posted: [Source]
Tags:  terminal tip

Sometimes when you develop, you might find yourself with strange error. It says that the process you're trying to start is trying to use port, that is already being used. It's strange, because it is usually You, who used this port on previous run. If that's the case, then fuser command should relieve you from this error.

For example:

fuser 6543/tcp -k

The k parameter is responsible for actual killing. Without it, the command would just identify which process is using port/socket in question.

Comments powered by Disqus