title: unix: how to cat from 2 inputs?
body: <p>in UNIX scripting programming, cat is a command that could combine 2 files together:</p>
  
  <pre><code>cat file1 file2 &gt; file3
  </code></pre>
  
  <p>this generate the 3rd by combining the first two.</p>
  
  <p>also, cat could be used with pipe:</p>
  
  <pre><code>cat file1 | tail -4
  </code></pre>
  
  <p>this will list the last 4 lines of file 1.</p>
  
  <p>question: how could I combine the last 4 lines of file 1 and 2, to generate file 3?</p>
  
  <p>i'm a bit lost here: how to give 2 streams inputs to cat?</p>