Using 'screen' - The Absolute Essentials

This post is a few years old now, so some details (or my opinions) might be out of date.
I would still love to hear your feedback in the comments below. Enjoy!

You’re probably here because you heard screen is a more “safe” way to ssh, so that a broken connection won’t terminate your processes. Here’s how to do it:

Installation

sudo apt-get install screen

Initial connection

$ ssh rachum@server$ screen

Reconnection

$ ssh rachum@server
$ screen -ls
There is a screen on:
    8793.pts-5.ubuntu    (11/04/2013 11:17:45 PM)    (Attached)
1 Socket in /var/run/screen/S-rachum.

… And that’s all you need to know to get something out of screen.

So what is this about? If you take a look at screen’s man pages you’ll read that:

Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells).

Which is true, but not very helpful. While you may use screen’s multiplexing-window-managing features, you most likely came across it while looking for a way to ssh to some machine and run something that won’t die when you disconnect. Multiplexing comes later. If you’re interested in screen’s more advanced features, check out some of these guides.

Discuss this post at the comment section below.
Follow me on Twitter and Facebook