Gnuru.org
Productive Linux


Subscribe

 Subscribe via Feedburner in a reader

Enter your email address:

Delivered by FeedBurner


Login
Login:
Password:



Don't have an account?
Sign up to Gnuru.org
Forgot your password?

Using screen to run processes
25 March 2004 @ 13:10 GMT
by Paul

It often happens that you need to detach a process from a login session. This might occur, for example, if you are using [ssh] to login to a remote server that you are administering and wish to run a lengthy process. You don't want to keep the ssh session open for the entire time the process runs. In fact, you might even want to login from another computer to check up on the process as some later stage.

One answer is to use GNU [screen]. This incredibly useful program allows intricate managment of your login sessions. For the above task, however, you do this:

  • login in to your ssh session
  • type
    screen
    at the command prompt
  • type whatever commands are required for your length process
  • type
     control-a d 
    . This detaches the process from the login session
  • logout

When you want to check up on your process again:

  • login
  • type
    screen -r 
    to reattach the process to your login session
  • Do whatever it is you want

Nothing could be easier, or more convenient!




Comments disabled