Monday, June 28, 2010

using SCREEN command in Linux

There are times when you want to log off your system, but you want the programs to be executed on the server machine which you've initiated from your system. You can use screen command which serves this purpose. It starts a session within the session that you have logged in. Even if you logout from your system, the screen will keep on running until the server stops or you forcefully exit.

Here are the commands which you should use.

$screen //starts a new session in the logged session

$./a.out > output //some command which you want to get it executed

$ CTRL + a + d //closes the screen and brings you back to the original session

$screen -r //displays the screens running on your machine

Hope this is helpful :-)

No comments: