Check all lines of a file are unique

text processing

I have a text file containing lines like this:

This is a thread  139737522087680
This is a thread  139737513694976
This is a thread  139737505302272
This is a thread  139737312270080
.
.
.
This is a thread  139737203164928
This is a thread  139737194772224
This is a thread  139737186379520

How can I be sure of the uniqueness of every line?

NOTE: The goal is to test the file, not to modify it if duplicate lines are present.

Best Answer

[ "$(wc -l < input)" -eq "$(sort -u input | wc -l)" ] && echo all unique
Related Question