i have two files as below
file1
abc
def
def
ghi
jkl
mno
pqr
pqr
fil2
123 abc is a teacher
234 lkm is a doctor
434 def is a pilot
432 def is a engineer
544 pqr is a scientist
345 kfd is a student
454 pqr is a lawyer
i want to get output as below
123 abc is a teacher
434 def is a pilot
432 def is a engineer
544 pqr is a scientist
454 pqr is a lawyer
please give me your suggestions
i tried with
awk 'NR==FNR{a[$0];next}!($0 in a)' file1 file2
but i'm not getting proper output with duplicates
also tried
'grep -Ff file1 file2'