combining unix stderr output with stdout

Tags: unix
Updated: December 04, 2008
Contributors: Mike Franks

The problem is that when I run script x and redirect it to a file, all of the error messages come to the screen when I want them to also go to that file.

With bash shell, use:

program > outputfile 2>&1

My colleague found this for me in the book Unix Power Tools which is available online at UCLA here. http://proquest.safaribooksonline.com/0596003307