title: Create new file with duplicities of a file
body: <p>I have the command below which extracts rows that are duplicates based on their second column (<code>file.csv</code> is comma-separated):</p>
  
  <pre><code>awk -F',' '{print $2}' file.csv | sort | uniq -d | grep -F -f - file.csv &gt;file.bad
  </code></pre>
  
  <p>But on Solaris, this command doesn't work because of the <code>-F</code> parameter of the <code>grep</code> command is not supported.</p>
  
  <p>Example of lines in the original file:  </p>
  
  <pre><code>"A","TEST","Other","TEST",...  
  "A","TEST2","Other A","TEST2",...  
  "A","TEST","Other B","TEST",...
  </code></pre>
  
  <p>Example of lines in the new file:  </p>
  
  <pre><code>"A","TEST","Other","TEST",...  
  "A","TEST","Other B","TEST",...
  </code></pre>