title: Checking if values in a specific column are the same in the same column for the line below?
body: <p>I am looking for a Linux command in which I can compare if, for a single column, the line below is the same value as the line currently being checked, and if they are then output both lines. My file is tab separated.  </p>
  
  <p>Input example:</p>
  
  <pre><code>line 1  1   var281  7
  
  line 2  1   var100  80
  
  line 3  1   var99   85
  
  line 4  2   var281  90
  
  line 5  2   var281  91
  
  line 6  2   var300  61
  
  line 7  3   var50   45
  
  line 8  3   var99   14
  
  line 9  3   var99   19
  
  line 10 3   var670  80
  </code></pre>
  
  <p>Desired Output:</p>
  
  <pre><code>line 4  2   var281  90
  
  line 5  2   var281  91
  
  line 8  3   var99   14
  
  line 9  3   var99   19
  </code></pre>