Created
January 6, 2016 18:21
-
-
Save penghou620/4b54552ceecc6050e396 to your computer and use it in GitHub Desktop.
Tmux kill un-attached sessions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tmux ls | grep --invert-match 'attached' | awk '{print $1}' | grep -oh '[0-9]\{1,\}' | xargs -n 1 -I {} tmux kill-session -t {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had gotten this far before I googled "tmux xargs kill-session" and wound up here:
ϡ tmux ls|grep -v attached|awk '{ print $1 }'|sed 's/://'