AddThis

Thursday, August 18, 2011

Tee Off!

I love the tee command.  It's simple and beautiful and allows you to echo your output to both the console and to a file.

./run.sh | tee run.out

Here, my run.sh output will be nicely shown on the screen for me, but if the contents exceed my console's buffer, have no fear!  The output is also echoed to run.out.  Yay!

1 comment:

Jon V said...

If you're running bash shell or some variant, don't forget that if you also want to see stderr as well as stdout, add "2>&1" to the end of the command...