title: Useless use of cat?
body: <p>This is probably in many FAQs - instead of using:</p>
  
  <pre><code>cat file | command
  </code></pre>
  
  <p>(which is called useless use of cat), correct way supposed to be:</p>
  
  <pre><code>command &lt; file
  </code></pre>
  
  <p>In the 2nd, "correct" way - OS does not have to spawn an extra process.<br>
  Despite knowing that, I continued to use useless cat for 2 reasons.</p>
  
  <ol>
  <li><p>more aesthetic - I like when data moves uniformly only from left to right. And it easier to replace <code>cat</code> with something else (<code>gzcat</code>, <code>echo</code>, ...), add a 2nd file or insert new filter (<code>pv</code>, <code>mbuffer</code>, <code>grep</code> ...).</p></li>
  <li><p>I "felt" that it might be faster in some cases.  Faster because there are 2 processes, 1st (<code>cat</code>) does the reading and the second does whatever.   And they can run in parallel, which means sometimes faster execution.</p></li>
  </ol>
  
  <p>Is my logic correct (for 2nd reason)?</p>