Why Screen
1. You are using SSH client to connect to a Linux Server, the network die by accident, you lost all your works. Screen resolves this issue by providing a virtual terminal which you can reconnect at any time.
2. You are opening a document, meanwhile you want to type some commands according to the document, you have to open and close this document again and again. Screen resolves this issue by providing 2 virtual terminals, you can switch between these terminal and copy/paste between them.
Install and configure Screen
1. yum install screen
Play with Screen
1.Type
screen to create a new Screen,
screen -r to connect to an existed screen
2.Open a document
vi README
3.You want to open the 2nd terminal
Press CTRL+a, then Press c,
Screen creates a new terminal for you and the new terminal is active.
If you want close the 2nd terminal, type
exit
4.You want to go back to 1st terminal,
press CTRL+a, CTRL+a
You cant to list all termical
CTRL+a, "
5.You want to copy/paste some lines,
press CTRL+a, ESC,
press h,j,k,l to move the cursor,
press SPACE to start select
press h,j,k,l to highlight
press SPACE to stop highlight and put the highlight lines to buffer
press CTRL+a, CTRL+a to switch to 2nd terminal
press CTRL+a, ] to paste the lines from the buffer
6. You want to split the screen
CTRL+a, S (Upper case),
to switch from the screen, press CTRL+a, TAB
by default,a new screen does not connect to any terminal , press CTRL+a, n to connect a screen to a terminal
to close a screen, press CTRL+a, X(upper case)