I have two text files, one with the following content:
Brazil
China
USA
And another file with the following content:
Brazil 8 9 5 2
China 1 2 2 1
France 7 4 1 2
Italy 0 1 2 3
Spain 5 4 6 8
UK 8 5 4 1
USA 1 2 3 4
I would like to use some command that compares both files and returns
Brazil 8 9 5 2
China 1 2 2 1
USA 1 2 3 4
The command comm doesn't seem to work in cases like this. How could I solve it?
Edit: although this question is marked as duplicated, the solutions for the other question are not the same presented here.