As followup of this question, I would like to know where the STDOUT and STDERR of a program on which I've run disown -h is redirected to.


disown does not change the programs STDOUT/ERR. They will still go to wherever you redirected them (using > etc.). If you did not redirect them, they'll continue to go into the terminal you started the program from (until you close that terminal, in which case they'll be discarded).

To illustrate, run this in a terminal:

bash -c 'while true; do sleep 1; echo hi; done' &

This will print "hi" every second (and annoy you terribly ;-)). If you disown the program after start, the "hi"s will just continue. You need to find the shell's PID (using e.g. ps) and kill it to make it stop.


Based on the comments, maybe what you really want to do is to recover the output of the program after you disowned it and closed the terminal it was running in. This is explained in this question: After-the-fact remote nohup with tcsh (thanks to quack quixote).

  • According to his previous question, the fact is that he closed this previous terminal. How can he get the output, then? – Gnoupi Mar 29 '10 at 9:39
  • @Gnoupi: I don't think there's any way to get the output back. At least I've never heard of any way. – sleske Mar 29 '10 at 9:43
  • Thanks for the comment Gnoupi :-) In facts, the output is nowhere to be found. I'll keep looking though :-) – Thrawn Mar 29 '10 at 9:45
  • 1
    this really is the answer: disown doesn't change anything; you need to setup any capture or redirection when you start the process. if you need it afterwards, gdb is your (only) friend: superuser.com/questions/50058/… – quack quixote Mar 29 '10 at 9:48
  • @quack - I would say that the question needs refactoring, then, to emphasize on the actual use case, rather than only the tool. In the current form (centered on disown), this is indeed the correct answer. But from the context, with the previous question, the user wants simply to recover the output, and in this case your link is the answer. – Gnoupi Mar 29 '10 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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