Server Fault is a question and answer site for system and network administrators. 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

I have a program that runs indefinitely. I which to run this program remotely by issuing the following command:

nohup mono program.exe &

Although I'm able to close the terminal and still have program.exe running, I would like nohup to return me the command prompt ($), so that I can issue more commands before terminating.

How do I go about doing this?


Answer (or workaround)

Do an explicit redirection of the standard output and errors streams

nohup mono program.exe >> nohup.out 2>&1 &
share|improve this question

If you execute the command in the way described above, you will get back the command prompt.

You are executing it in the background. So, you should get back the command prompt before terminating the process program.exe. This is not the case!!!?

share|improve this answer
Agreed, as long as you have "&" it should return you to the prompt. Perhaps Mystic is running this from something other than a normal terminal window? It doesn't sound like it though... Mystic? More information please? – Sean Reifschneider Nov 30 '10 at 8:57
Based on what I thought should have happened, I agree that I probably should have gotten the prompt. My program busy-waits (with 1 second sleeps) on the main thread. It doesn't block on input from the terminal. I doubt if that is causing the problem, or is it? – Mystic Nov 30 '10 at 10:10
@Mystic: Just try this: "$ nohup sleep 20 &". You should get the prompt without waiting for 20 seconds. Your application execution should behave in a similar way! – Khaled Nov 30 '10 at 10:20
Tried that using both putty and the ssh client that comes with Cygwin. Neither works. I need to hit the return key in order to see the prompt. Any ideas? – Mystic Dec 1 '10 at 3:55
@Mystic: So it is ok if you can do it without waiting. – Khaled Dec 1 '10 at 9:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.