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

Is there a way to flush the buffer that nohup buffers stdout? From what I read in various places (eg. some place) is that I can modify the behaviour from within my programm. But that would be specific to each programm, and there are some where I would not want to mess with the code.

So I am looking for a general way to tell a 'nohuped' programm to flush stdout. Something on the commandline likeflush sdtout <PID>. Is there something like that? Or some sort of workaround?


share|improve this question
What kind of output does your program generate? (Line oriented with trailing newline?) What OS and programming language do you use? – MattBianco Sep 16 '10 at 14:21
Line oriented with trailing newline. OS Linux, programming langue varies: bash, perl, python ... I was looking for something independent of the used language, but maybe I am on the wrong track there. – Isaac Sep 16 '10 at 14:58
up vote 0 down vote accepted

It's possible the (deceptively simple) unbuffer script that comes with expect may do what you're looking for.

share|improve this answer
Thank you, that is pretty much what I was looking for. Very helpfull! – Isaac Sep 17 '10 at 13:59
So, would it be like nohup unbuffer &? – István Zachar Aug 14 '14 at 6:41

Your Answer


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