I know my title is not much self-explanatory but let me try to explain it here.
I have a file name test.txt which has some duplicate lines. Now, what I want
test.txt
this is not as inefficient as it looks:
sort -u test.txt > test.txt.tmp && mv test.txt.tmp test.txt