Screen is a very useful utility program that are able to multiplex multiple terminal sessions in a single terminal session.
For instance if you are logged in to a remote terminal via SSH it is easy to create sub-sessions without logging in to an extra terminal. In the example below I;
remote.host.org as user userAas follows
ssh user@remote.host.org
screen -S A
C-a c
C-a n
Another very useful feature is the possibilty to start screen in “detached” mode. This means that you can start a time comsuming tast on a remote machine. Log out. And the attach to the same session again.
In the example below I;
script.sh in detached mode using UTF-8 character set with name set to A.A to check status of script.as follows
screen -dm -U -S A ./script.sh
screen -dr A
C-a d
To clean up old screen windows do;
screen -wipe
pkill -9 screen
See screen(1) for details. Also see article Staying alive with screen.