The Bourne shell, Bourne-again shell, and Korn shell notation digit1 >& digit2
says to redirect descriptor digit1 to the same file as descriptor digit2 . What is the difference between the two commands ./a.out > outfile 2>&1
./a.out 2>&1 > outfile
(Hint: the shells process their command lines from left to right.) |