title: Shell redirection i/o order
body: <p>I'm playing with i/o shell redirection. The commands I've tried (in bash):</p>
  
  <pre><code>ls -al *.xyz 2&gt;&amp;1 1&gt; files.lst
  </code></pre>
  
  <p>and</p>
  
  <pre><code>ls -al *.xyz 1&gt; files.lst 2&gt;&amp;1
  </code></pre>
  
  <p>There is no any <code>*.xyz</code> file in current folder.</p>
  
  <p>These commands gives me the different results. The first command shows an error message <code>ls: *.xyz: No such file or directory</code> on the screen. But the second one prints this error message to the file. Why did the first command failed to write an err output to the file?</p>