I have two files
file1:
45 789
46 4546
78 4564
71 546
file2:
41 456
46 456
40 465
45 456
I would like to compare these files and get an output: if the number in first column from first file is in the first column of the second file print a row from second file that include this number.
Desired output:
46 456
45 456
It will be something with grep? Thank you very much