Please use following command in linux to find duplicate lines in file1.txt and in file2.txt. Duplicate lines will be stored in duplicate.txt
comm -12 <(sort file1.txt) <(sort file2.txt) > duplicate.txt
comm -12 <(sort file1.txt) <(sort file2.txt) > duplicate.txt