Use screen to manage persistent sessions

GNU Screen is a command-line application that allows use of multiple virtual sessions within a single real terminal or remote session. Importantly, it allows for persistent running of command-line applications independent of the shell that initiated them program, meaning active applications can persist during disconnection.

This is just one of many things that screen is useful to accomplish! You can also use multiple screens to run concurrent applications on a remote or local server from a single terminal window.

Method

Connect to the remote server, for example using ssh

python
ssh user@example.com

On the remote server start screen before any other commands. You will see the screen welcome text shown. Press any Space or Return to exit back to the shell. step/None/screen-screenshot.png

You can now start any long running process that you wish to persist over the connection.

python
ping example.com

While this command is running you can now 'detach' the running screen from the active session by pressing Ctrl-A followed by Ctrl-D on the keyboard. You will notice that the active session returns to the point where you first typed screen.

Exit the running ssh session by typing exit. Make a cup of tea. You can now reconnect to the server as before.

python
ssh user@example.com

Back at the remote prompt you can re-attach the previously started screen to the current session.

python
screen -r

You will see your command continued to run while you were away!

Continue reading

SAM Coupé SCREEN$ Converter

The SAM Coupé was a British 8 bit home computer that was pitched as a successor to the ZX Spectrum, featuring improved graphics and sound and higher processor speed. The SAM Coupé's high-color MODE4 could manage 256x192 resolution graphics, with 16 colors from a choice of 128. Each pixel … More

Elsewhere