title: Appending vs. Concatenating Large Files in Linux
body: <p>Let say I have 5 very large 100GB files.
  <code>file1</code> <code>file2</code> <code>file3</code> <code>file4</code> <code>file5</code></p>
  
  <p>If I wanted to combine them into <code>fileAll</code>, is there a speed (read/write) difference between the following two ways? (Let's disregard working disk space for now)</p>
  
  <p><strong>Cat and redirect:</strong></p>
  
  <p><code>cat file1 file2 file3 file4 file5 &gt; fileAll</code></p>
  
  <p><strong>Cat, append, and move/rename:</strong></p>
  
  <p><code>cat file2 file3 file4 file5 &gt;&gt; file1</code></p>
  
  <p><code>mv file1 fileAll</code></p>
  
  <p><strong>My assumtion:</strong></p>
  
  <p>I assume <code>cat</code> will read in each file entirely that it is concatenating (in this example a total of 500GB worth of reading) and then redirect <code>&gt;</code> will write out everything (total 500GB worth of writing).</p>
  
  <p>In the second example, I am assuming that <code>cat</code> will read in one less file (total 400GB worth of reading) and then when appending <code>&gt;&gt;</code> simply write out that in the space after the file we are appending to (total 400GB worth of writing).</p>
  
  <p>Am I correct in assuming that <strong>appending does not have to read in the entire file being appended to and can simply start writing at the end of that file?</strong></p>