Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have some dead connection in one application which is in hanged state if client machine is dead.


Is there a way to terminate these option from linux command line without restarting the server?

After search I found solution called as tcpkill. But it will not work for me. As it permanently blocks that ip.

share|improve this question

2 Answers 2

tcpkill might do it for you. In Ubuntu it is in the dsniff package.

Something like:

$ sudo tcpkill -i wlan0 host

(or some other tcpdump like expression for what connection to kill).

share|improve this answer

Do - as root netstat -tunp|grep 49029. The last column of the output should show you the PID and program name of the process responsible for that connection.

If you are lucky there is a single process for just that connection.

If you are unlucky it gets more complicated (the PID is responsible for more than just that one connection). What kind of service is this?

Why do you want to terminate that session?

share|improve this answer
I can't kill that process. It is gearman server. I want to just close the connection. –  Vivek Goel Apr 10 '13 at 13:34

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.