Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

How can I split an output of a command to two terminals? one will get stdout and the other will get stderr. The best I could do is:
On first terminal:

command args 2> errors

and on second terminal

while 1
    cat errors
    sleep 1

This works ok but it prints the errors over and over again every time, is there any better way to redirect the errors to another terminal?

share|improve this question
up vote 4 down vote accepted

I don't know if this is 100 % correct.

Do the same thing on the first terminal, and on the second terminal don't use a "while" at all. Use tail -f errors to tail the errors file.

share|improve this answer

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.