How To: Screen the Ultimate admin tool

1 minute read

Screen is a must know GNU console tool, this small piece of software comes really handy when you are working on a console or sending long processes on a remote host.

When you start screen, you simply get a terminal prompt, but then, many features are given to you. Most users don’t even know about it, but you will soon love it.

From GNU:

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

Along this tutorial, we are going to start a screen session and start different windows. Then we will see how to use the some essential features from screen, such as naming windows, navigating from window to window.

Mind that key binding will be written in bold and that it is case sensitive, where Ctrl-x y means pression Control and x simultaneously.

Installation

As usual, before using softwares, you need it to be install on your system. In order to install screen on a debian based system, you need to:

sudo apt-get install screen

Starting a screen session, dettaching and reattaching it

Now that everything is up, let’s start your first screen instance giving it the name screen-session:

screen -S screen-session

As you can see, you get a new prompt inside the previous terminal. Let’s start a program inside this shell, irssi -c irc.debian.org for instance.

irssi -c irc.debian.org

Okie, once logged in, join a channel (/j #debian) and detached the session (Ctrl-a d). You are getting back to your previous shell and told that the session is [detached].

You can go back to your screen session by attaching the session back:

screen -x screen-session

As you can see, the irc session is still running on :smile:.

Creating more windows

screen can actually handle more than one window per session. In order to create a new window, type Ctrl-a c keybinding, you then get a new prompt, let start top in that window:

top

And again a new window, Ctrl-a c where you will start for instance nload (a network traffic analysis software):

nload

Follow with Part 2