The GNU screen is a terminal multiplexor. It enables users to run a collection of multiple, independent shells within the terminal (no parent-child relationships, so each shell can run its own programs independently without “waiting” for its children to die). screen can be detached from its terminal, and later reattached to any other terminal, without losing any running programs. Here’s a short tutorial:
$screen launches shell #0 in the terminal.
Let’s run an application here to mark this shell, say irssi.
^a c launches shell #1 in the terminal.
In this shell let’s run the w3m browser: w3m google.com
^a c launches shell #2 in the terminal.
Here, I run a ping: ping yahoo.com
^a c launches shell #3 in the terminal.
Here we ‘ll do a simple file listing: ls -l
Another ^a c will launch shell #4, yet another will launch shell #5 and so on.
Now we can cycle through the open shells with ^a [SPACE], or go to a numbered shell with ^a num.
We can also give names to shells:
First go to shell #0: ^a 0.
Now give it a name: ^a A Type chat when it asks for a name.
Similarly assign names to shells 1, 2 and 3, say browser, ping and listing respectively.
Now do ^a “ to see a list of open shells, and move up and down between them with k and j respectively.
You can even detach the entire screen (with all its shells) from the terminal. Just do ^a d. Now type exit and logout of the terminal. The terminal is gone, but the programs are still running inside screen. Fire another terminal and type screen -r to reattach the screen with all its shells and programs intact. Shells inside a screen are terminated by the regular command exit.
Lear more about screen from these pages:
GNU Screen: an introduction and beginner’s tutorial
screen – The Terminal Multiplexer
A Visual Introduction to Screen