863
To kill all detached screen sessions, include this function in your .bash_profile:
killd () {
for session in $(screen -ls | grep -o '[0-9]\{5\}')
do
screen -S "${session}" -X quit;
done
}
to run it, call killd
Alternatively, while in your screen session all you have to do is type exit
This will kill the shell session initiated by the screen, which effectively terminates the screen session you are on.
No need to bother with screen session id, etc.