How to check "item" is in multiple files?

view story

http://www.unix.com – I have multiple files: Code: file1: one two three file2: two four six file3: one two ten These are all in a directory called dir1 I also have multiple other files: Code: x_file1: one six ten x_file2: three eight nine x_file3: seven one five These are all in a directory called dir2 I want to run through each of the first set of files in dir1, and check if any of those items are in any of the other set of files. So in this case I would want my output to be: Code: output: two four (HowTos)