Using 'screen' - The Absolute Essentials

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:


sudo apt-get install screen

Initial connection

$ ssh rachum@server$ screen


$ 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 , Facebook or Google+