How to print matching lines in grep

by admin April 3, 2011 at 7:15 am

How to print matching lines in grep

You have 2 files and if you wants to print the matching line from one file to another use below command.

cat a.txt | while read i ; do grep “$i” b.txt ; done;