title: How to compare lines based on a column using awk or grep
body: <p>I would like to compare my data line by line. Each entry has a copy and some differ in some columns (It is tab delimited). As an example</p>
  
  <pre><code>1   0   chrX    121843122   255 16M
  1   0   chrX    79062186    250 16M
  2   0   chr3    79062186    255 16M
  2   0   chr7    79062186    255 16M
  3   0   chr3    166649831   255 16M   
  3   0   chrX    12345678    255 16M
  </code></pre>
  
  <p>I would like to find out if both of the pair (based on column1) has chrX, the rest of the columns might be different.</p>
  
  <p>In the above example I will only keep (it only matters column 1 to be same and column 3 to be chrX for both.)</p>
  
  <pre><code>1   0   chrX    121843122   255 16M
  1   0   chrX    79062186    250 16M
  </code></pre>
  
  <p>I wanted to try this in awk but it only seems to work columnwise. How can i implement this using awk or grep?</p>