Run multiple recoverabele sessions with screen

Sometime you nee to run a script or something like that on a remote host and you can’t be sure, that the remote session will preserve until the script has finished. Another case is mobile working. Sometimes you need the possibility to start a script on one place, send your disconnect the ssh client and open another one somewhere else. That’s all possible with screen:

Open screen session


Jump back to main session

With the following shortcut you can detach the current screen session so that you can reattach it later:

ctrl+a and then d

List all open sessions

$> screen -ls

Reattach a closed session

$> screen -r [SID]


To kill a screen that you’ll never need again, do this in the already attached screen:

$> exit

More Information

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.