Skip to content

random($foo) is the occassionally still updated blog of Leonard Lin. My pics are on Flickr, code is on Github. @lhl on Twitter.   More »

random($foo)

Killing Stale Connections

Posted on January 12, 2006January 12, 2006 by lhl

This will also kill your current connection, but it’s really simple:

ps axw | egrep 'lhl' | grep sshd | awk {'print $1'} | xargs kill

  • Unix Review: Using the xargs Command
  • Pkill.sh [Shell script to kill process by name]
  • pkill w/ a for loop
  • FreeBSD port of pkill
  • pgrep and pkill for BSD
Posted in Legacy

Post navigation

End of the Year, Beginning of the Year
Worth Posting