Here is file1.txt:
.apple .ball .cow
.apple .cow .tea .mine.nice
.mine.nice
.tea
.zebra
Here file2.txt
.apple
.mine.nice
.cow
.tea
Expected Result:
.apple .cow .tea .mine.nice
.mine.nice
.tea
while using following does not give expected result
grep -w -F -f file2.txt file1.txt
gives
.apple .ball .cow
.apple .cow .tea .mine.nice
.mine.nice
.tea
How to get expected result?