TLDR
The original question was unclear, and read that the OP simply wanted a unique version of the contents of a file. That's shown below. In the since updated form of the question, the OP is now stating that he/she simply wants to know if the contents of the file is unique or not.
Test if file's contents is unique or not
You can simply use sort
to verify if a file is unique or contains duplicates like so:
$ sort -uC input.txt && echo "unique" || echo "duplicates"
Example
Say I have these two files:
duplicate sample file
$ cat dup_input.txt
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
unique sample file
$ cat uniq_input.txt
A
B
C
D
Now when we analyze these files we can tell if they're unique or contain duplicates:
test duplicates file
$ sort -uC dup_input.txt && echo "unique" || echo "duplicates"
duplicates
test unique file
$ sort -uC uniq_input.txt && echo "unique" || echo "duplicates"
unique
Original question (unique contents of file)
Can be done with just sort
:
$ sort -u input.txt
This is a thread 139737186379520
This is a thread 139737194772224
This is a thread 139737203164928
This is a thread 139737312270080
This is a thread 139737505302272
This is a thread 139737513694976
This is a thread 139737522087680