Find all files with the extension .txt, print the first line of each file, sort the lines, remove duplicate lines, and delete the files associated with the remaining lines.
find . -name '*.txt' -exec head -1 {} \; | sort | uniq -u | xargs -d '\n' rm