title: Bash: Remove unique and keep duplicate
body: <p>I have a large file with 100k lines and about 22 columns. I would like to remove all lines in which the content in <strong>column 15</strong> only appears once. So as far as I understand its the reverse of </p>
  
  <pre><code>sort -u file.txt
  </code></pre>
  
  <p>After the lines that are unique in column 15 are removed, I would like to shuffle all lines again, so nothing is sorted. For this I would use</p>
  
  <pre><code>shuf file.txt
  </code></pre>
  
  <p>The resulting file should include only lines that have at least one duplicate (in column 15) but are in a random order.</p>
  
  <p>I have tried to work around sort -u but it only sorts out the unique lines and discards the actual duplicates I need. However, not only do I need the unique lines removed, I also want to keep every line of a duplicate, not just one representitive for a duplicate. </p>
  
  <p>Thank you. </p>