Match the records in two files.

Hi all please give me the solution for this im stuck somewhere.

I have two files A and B
file A has 300 records as
000.aud
111.aud
.
.
.
300.aud

file B has 213 records randomly
005.aud
176.aud
.
.
.
200.aud

I want to match similar 213 records in file B from file A.
Please dont use the diff A B > C command I tryd it its difficult to find the matches help with some other command please.

Regards
Anwar.

awk ' FILENAME=="A" {arr[$0]++}
        FILENAME=="B" { if ($0 in arr) {print $0} } '  A   B  > duplicate.lis

Perhaps the comm command would help you.

sort file1 >file1.tmp
sort file2 >file2.tmp
comm -12 file1.tmp file2.tmp
rm file1.tmp file2.tmp

Those commands should show you the common lines between you two input files (called file1 and file2).