RSS

Screen | Linux Command

01 Feb

Taken From : TheDanishProject

When you run commands and programs in a command prompt on Linux, the programs or commands only run while the command prompt session is open but as soon as the command prompt session is terminated for whatever reason, the commands or programs running within the command prompt session will also get terminated.

Using wget to download files from the internet using putty console is an oldschool technique. But imagine downloading a 500mb file and then suddenly putty crashes causing the session to terminate along with it. There goes the 500mb file download!! “Screen” is a lifesaver in these situations

The screen program is a magnificent utility. Screen basically starts a session within the the session that you logged in with. So, if your putty session suddenly crashed don’t worry, the screen session would still be running in the background. Log in again to the server usingputty and you should be able to retrieve the screen session you initiated earlier.

# screen

This starts a screen session.

# Ctrl + A followed by D

This will detach your screen session and return you to the original session you logged in with. Your screen session will now be running in the background.

# screen -r

This command will resume your previous screen session.

# Ctrl + A followed by Ctrl + \(back slash)
# exit

You could run either command above to end a screen session.

# Ctrl + A followed by “

This command will list all the available screen sessions running if there are.

Usefull Links:
O’REILLY Linux Command Directory

Inside Open Source

 

 
Leave a comment

Posted by on February 1, 2011 in Unix / Linux

 

Leave a comment