> ## Content Index
> Fetch the complete content index at: https://mfitzp.ghost.io/llms.txt
> Use this file to discover other available public pages before exploring further.

# Use screen to manage persistent sessions
- URL: https://mfitzp.ghost.io/use-screen-to-manage-persistent-sessions/
- Published: 2011-10-02T00:00:00.000Z
- Updated: 2026-09-09T09:14:05.000Z
- Author: Martin Fitzpatrick
- Tags: Tutorials, Bash, #Import 2024-03-14 08:20, #Import 2026-08-24 14:26

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.*

Connect to the remote server, for example using `ssh`

```Bash
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](https://storage.ghost.io/c/50/3e/503e92e5-9187-4058-a6fd-d37b3deb22ec/content/images/2026/09/screen-screenshot.png)

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

```Bash
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.

```Bash
ssh user@example.com

```

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

```Bash
screen -r

```

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