#!/bin/bash
count=0
# get a file name other than the first or second as a ref to start
last=$(ls -lf 2*.txt | head -n5 | tail -n1)
for i in 2*.txt ; do 
  a=$(diff $i $last)
  count=$((count+1))
  if [[ $a == '' ]] ; then
    echo "$count) $i $last are the same"
    rm -f $last
  fi
  last=${i}
done
