perl -anle"@L = @F, next if $. == 1; print if $L[0] eq $F[0]; @L = @F;" in.txt > out.txt