title: Count and sum up duplicate records in a file (UNIX)
body: <p>I supposed to count the total the duplicate records in a file.</p>
  
  <p>I used </p>
  
  <pre><code> sort $TEMP_FILE2 | uniq -d
  </code></pre>
  
  <p>to list all duplicate records without count. My problem is, i do not know what script to use to sum up or get the total of those records. </p>
  
  <p>This should be my output:</p>
  
  <p>Total Data Count: xxx</p>
  
  <p><strong>Duplicate Data Count: xxx</strong> (Total duplicate records in a file)</p>
  
  <p>Final Data Count: xxx</p>