in reply to Re^3: Find duplicate lines from the file and write it into new file.
in thread Find duplicate lines from the file and write it into new file.

uniq can give you the dups directly:
sort foo.txt | uniq -d