How to use Screen for Linux
This tutorial will show you how to use Screen for Linux
Screen is an open source, free virtual terminal emulator. Screen allows you to run multiple terminal screens from within the one login. This tool is primarily used for resuming your work in applications at a second location at a later time, Without having to leave a terminal window open.
Screen could be seen similarly as a VNC client for terminal. You can start a compile or install process at one location (Like the office) then later on from home you can login to your server, and resume the same session you were working in earlier. Multiple users can also log into the same screen session from different locations and collaborate on work together. You can also create multiple screen sessions on the one server, and choose which screen session to resume later.
Firstly, if you do not already have screen installed, You can do so via default repositories.
apt-get install screen
or
yum install screen
Otherwise you can head to the GNU Screen website for download links and installation instructions: http://www.gnu.org/software/screen/
Once installed, Login to your server and start your screen session by typing: screen
Once logged in to your screen session, you may start whatever applications as normal.
When your application is running, You may close your terminal window and your application will continue to run in the background, Waiting for you to log back in and resume your screen session.
You can then log back into your server as normal, Once logged in type: screen -r
Provided you only have one instance of screen running, This will resume your screen session. Otherwise It will display a list of screen sessions you are able to resume by typing screen -r [screen ID]
You will now see your application which has been running in the background.
At any stage if you wish to exit your screen session simply type Cntrl-C to exit back to your original console.