Recently I unintentionally created and run a fork bomb in bash. It was a slow one, in comparison to other fork bombs, I had plenty of time to do something. But there were already several hundreds of bash instances when I found out though.
My first thought was to do
killall bash
but this kills the shell I'm in and the killall with it.
Then I ran :!killall bash
from Vim and it was settled.
But what if I had no Vim running? Every terminal I have starts bash by default. How could I kill every bash instance but the one I'm in?