
For example, if you open a GNOME Terminal window, start a download with wget, and then quit the Terminal Window, the wget download will end too. This is annoying if you’re sometimes over-eager to clean up the desktop and quit terminal windows, like me!
If you access your computer across a remote session, perhaps via SSH, and want to run a program that will take a long time to complete, this can become seriously annoying. You have to stay logged in until the program has completed.
But getting around this is easy and you can use the handy screen program. This isn’t specifically designed to be an aid to remote logins, but there’s no reason why it cannot be used in such a situation.
The screen program effectively starts shell sessions that stick around, even if the shell window is closed or the ssh connection is ended or lost. After logging in to the remote computer via ssh, you can start a screen session by simply typing the program name at the prompt:
screen
After pressing the spacebar as prompted to start the program, there won’t be any indication that you’re running a screen session. There’s no info bar at the bottom of the terminal window, for example. screen works completely in the background.
Let’s consider what happens when you detach and then reattach to a screen session. To detach from the screen session, press Ctrl+A and then D. You’ll then be returned to the standard shell and, in fact, you could now disconnect from your ssh session as usual. However, the screen session will still be running in the background on the remote computer. To prove this, you could log back in, and then type this:
screen -r
This will resume your screen session, and you should be able to pick up quite literally where you left off; any output from previous commands will be displayed.
To quit a screen session, you can either type exit from within it or press Ctrl+A, and then Ctrl+\ (backslash).
The screen program is very powerful and you can have many “screens” as you want, so can juggle many tasks effectively in the background. To learn more about screen, read its man page. To see a list of its keyboard commands, press Ctrl+A, and then type a question mark (?) while screen is running.

Jul 10, 12:50 pm
screen is really handy. you dont even need to use it over ssh to get its benefits. at one point, i used screen just on the dekstop, before tabbed terminals became available.
nice tip.