Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 want to log the standard output and error info from running my program, using the following command:

  stdbuf -o 0 ./myprogram|& tee mylog

it works fine in one computer, I can see both standard output and stderr output on screen and in mylog. but in another computer, I can only see the standard output in screen and mylog. They are both Fedora OS and x86_64.

share|improve this question
Are you using the same shell on both machines? – Evan Teitelman Jun 20 '13 at 15:49
Also, please rephrase your question to be a real question. Are you looking for working alternatives to your current command or are you looking to find out why that doesn't work? – Evan Teitelman Jun 20 '13 at 15:53
up vote 2 down vote accepted

Try making both stdout and stderr unbuffered.

stdbuf -e 0 -o 0 ./myprogram |& tee mylog

Edit: I replaced my original answer. The above is most likely a solution to the problem.

share|improve this answer
strange, with stdbuf -o 0 ./myprogram 2>&1 | tee mylog, the problem persists – user1944267 Jun 20 '13 at 17:39
I have added another possibility to my answer. – Evan Teitelman Jun 20 '13 at 17:41

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.