gnu screen: reattach all previously detached sessions gnu screen: reattach all previously detached sessions unix unix

gnu screen: reattach all previously detached sessions


screen -d -r : Reattach a session and if necessary detach it first.

This will reattach your old session, will all its windows. If your session is still attached, it will detach it before attaching it to the current terminal. This is quite useful when for example you have kept your screen session in an ssh terminal on another computer.


To reattach all previously detached sessions I use this little script.

#!/bin/shfor line in `screen -ls | grep Detached |  awk '{print $1}'`; do   xdotool key control+shift+t type "screen -r $line"   xdotool key KP_Enterdone

"control+shift+t" happened to be a shortcut in my terminal for opening a new tab and it may be different shortcut in yours.