Illustrated Redirection Tutorial
Re: ">file 2>&1" vs. "2>&1 >file"<p>I tend to think "a>&b" as an assignment to a stream: stream[a]=stream[b]. This way it's easier to understand why the ordering matters:<p><pre><code>    >file 2>&1 means stream[1]=file; stream[2]=stream[1];
    2>&1 >file means stream[2]=stream[1]; stream[1]=file;</code></pre>