Awk one-liner?

Hello,
I have two files...

File #1

1 3
2 5

File #2

3 5 3
1 3 7
9 1 5
2 5 8
3 3 1

I need to extract all lines from File #2 where the first two columns match each line of File #1. So in the example, the output would be:

1 3 7
2 5 8

Is there a quick one-liner that would accomplish this?

Thanks so much!

mute@geek:~/test$ awk -v file2="file2" '{ while (getline line < file2 > 0) if (line ~ $0) print line; close(file2) }' file1
1 3 7
2 5 8
nawk 'FNR==NR{f1[$0];next} ($1 FS $2) in f1' file1 file2
1 Like

Great... thanks, guys.

*bow* I guess I need to read-up some more. :smiley: