Skip to content

Instantly share code, notes, and snippets.

@yqt
Last active October 15, 2019 08:16
Show Gist options
  • Save yqt/2e1b0df3212db7f36124121f44591ec7 to your computer and use it in GitHub Desktop.
Save yqt/2e1b0df3212db7f36124121f44591ec7 to your computer and use it in GitHub Desktop.
kill inactive ssh session
pstree -p | grep ssh | grep -v grep | awk -F '[()]' '{print $2}' | xargs -I {} sudo kill -9 {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment