apt-get install screen
Once screen has been installed, you can start it up by:
This command will get screen started, but you will not realize first. You can also name a screen session like this:
screen -S name
All the screen command starts with the combination keys CTRL+A, release the keys and then press the command. For example, ctrl+a and ? will list the commands available. Also, you should check the manual by running man screen.
List of commands:
- ctrl+a and | will create another vertical screen by splitting the screen;
- ctrl+a and c will create another screen window;
- ctrl+a and p will navigate backward through opened windows. p stands for previous;
- ctrl+a and n will navigate forward through opened windows. n stands for next;
- ctrl+a and " will list all opened windows. Here you can navigate by arrow keys and press enter to the desired one;
- ctrl+a and \ will exit screen with all the opened windows;
- ctrl+a and w or by typing exit at command line, will exit current opened window of screen;
- ctrl+a and d will detach the current window from screen and after exiting screen, your application inside the detached window will still be running;
After exiting screen you can always pick up previously detached window from screen. To list all screen:
If you have any screen windows detached you will geta message like this:
There is a screen on: 13378.name (03/19/2012 08:11:30 PM) (Detached) 1 Socket in /var/run/screen/S-root.
But, if you don't have any screen applications running, you will get a message like this:
No Sockets found in /var/run/screen/S-root.
You can restore your screen session by running:
screen -r 13378.name
where 13378.name is the name listed by screen windows listing command above.
Note: If your screen hangs-up, you've probably pressed CTRL+S. Press CTRL+Q and the screen will unfreeze.