Today I Learned

hashrocket A Hashrocket project

Tmux Kill All Other Sessions

Ok, you can kill a session in Tmux from the command line with tmux kill-session -t. Did you know you can add a flag to kill every session other than your target? Here’s that command.

$ tmux kill-session -a -t 
$ tmux kill-session -at  # short version

All sessions but the target will die. This is my ‘clear the desk’ operation when I come back to my computer after some time away and want to shut down a bunch of random servers and processes.