GNU Screen:
It is a terminal multiplexer.By using GNU Screen, we can run many number of applications,interactive command shells, text editors, etc. within a single terminal.
Inside the terminal user can open many windows terminal and sub-terminal.
Installation:
It can be installed in many flavours of Unix System.(I checked in all linux distro,AIX,Sun Solaris – it works)
Benefits:
(1) We can reconnect to screen terminal after network disconnection.
For eg.
In case ,while working suddenly if we face any Network Disconnection we are mostly out of the remote console terminal(ssh).At that time might be we are running any critical command ,due to network disconnection the process also get killed.But if we are using the screen terminal, we can reconnect back to same screen terminal in same state as you left.And you can see the process is still running.
(2) We can do the terminal sharing.
For eg.
If you are doing some important task and your colleague or friend also want to see what you are working on this terminal,they can also connect to screen terminal and can see what are you typing, + even he can also take part in activity and hits command in same screen terminal.
So many peoples can do troubleshooting/debugging the problem within a same terminal.
(3) We can do logging of our activity tracks like what commands are hit,what was the output etc.
There are many more features.I have shared only those which are generally used in screen.
Manual: http://www.gnu.org/software/screen/manual/
Commands and How to use screen:
Step 1: Run screen
command (type screen and press enter,it will open a new terminal inside ur current terminal ,by defualt when u hit enter u directly enter into screen terminal)
Step 2: Now you are inside screen.
For de-attach from screen press keyboard keys in flowing combination.
ctrl+a+d
Note:if you use exit command,you will come out of screen as well as the screen process will be killed.
Step 3: See the list of running screen process.
screen -ls
The output would be like this:
[root@server ~]# screen -ls
There are screens on:
21887.pts-1.server (Detached)
21554.pts-1.server (Detached)
2 Sockets in /tmp/uscreens/S-root
Note: Here I am using 2 screen terminal.
Step 4: Reattach to selected screen
get the list from screen -ls
command
for eg.
screen -r 21554.pts-1.server
Now u will be inside ur selected screen terminal. And perform the task.