Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Leave bash script running on remote terminal while not logged in?

Hi All, I run a program, say ./a.out 10 from the shell prompt. Assume that there's a while(1) inside the program being run. Now if I try to close the shell, it warns me that it'll kill my running program too! So, how to kill the shell and still let my program continue running in the background?

I tried exec ./a.out 10 but the shell is still there. Another alternative is to simply double click my executable but then how will I pass command line parameters?

share|improve this question

migrated from May 31 '11 at 15:45

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Sathya May 31 '11 at 17:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Same question here:… with some good answers, was closed as duplicate of…. – peth May 31 '11 at 15:57
up vote 8 down vote accepted

nohup is a POSIX command to ignore the HUP (hangup) signal, enabling the command to keep running after the user who issues the command has logged out. The HUP (hangup) signal is by convention the way a terminal warns depending processes of logout.

Use nohup:

$ nohup ./a.out 10 &
$ exit
share|improve this answer

You may also want to run your program in a screen session.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .