Find the answer to your Linux question:
Results 1 to 3 of 3
Hi everyone how i can make process background? i know that i can do it with typing & at the end of command, but when i log out of the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie DeoXMAN's Avatar
    Join Date
    Jul 2005
    Location
    Azerbaijan, Germany
    Posts
    154

    Background process question


    Hi everyone
    how i can make process background? i know that i can do it with typing & at the end of command, but when i log out of the system, this process stops.

    so, what is actually background process? is it process that runs when you log out, or it is process that runs but gives you free command line? and if it is second ,is it possible to make process continue to run when you log out?

    thanks!

  2. #2
    Linux Enthusiast KenJackson's Avatar
    Join Date
    Jun 2006
    Location
    Maryland, USA
    Posts
    510

    screen or cron

    If it's something you want to run from the command line right now and let it keep running even after you log out, I recommend 'screen'. You run the screen command, which just looks like Bash within Bash, and run your command. When you want to log out type type CTRL-A d to disconnect.

    Later, when you want to reconnect, run the 'screen -r' command, and you will see your old Bash terminal window just as if you never logged out.

    One note though: I prefer to put 'escape ``' (that's two back-tics) in my ~/.screenrc file and then use the back-tic "`" instead of CTRL-A. The latter conflicts with emacs and emacs-mode.

    If you want a job to run at a particular time, whether you are logged in or not, use cron. See man crontab.

  3. #3
    Just Joined!
    Join Date
    Oct 2004
    Location
    Warsaw, Poland
    Posts
    87
    Quote Originally Posted by DeoXMAN
    Hi everyone
    how i can make process background? i know that i can do it with typing & at the end of command, but when i log out of the system, this process stops.

    so, what is actually background process? is it process that runs when you log out, or it is process that runs but gives you free command line? and if it is second ,is it possible to make process continue to run when you log out?

    thanks!
    The easiest way is to type:

    Code:
    nohup the_command_you_want_to_run &
    This will make the command run even if you log out (leaving the log in nohup.out).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •