1

Redirecting stderr to file and duplicating stdout to both file and terminal is easy:

$ prog 2>error.log | tee output.log

tee will duplicate stdout, printing it to both terminal and output.log.

But what about redirecting stdout to file, and duplicating stderr to both terminal and file? How can that be accomplished? is there a tee equivalent that will duplicate stderr instead of stdout?

1 Answers1

1

It turns out it is just as easy...

prog 2>&1 > output.log | tee error.log