Working in linux/shell env, how can I accomplish the following:
text file 1 contains:
1
2
3
4
5
text file 2 contains:
6
7
1
2
3
4
I need to extract the entries in file 2 which are not in file 1. So '6' and '7' in this example and now where it found them. For example, 6, 7 in file 1
I already work with this awk command
awk 'FNR==NR{a[$0]++;next}!a[$0]' file1 file2
But this command can only show the difference, So, 6 and 7 but not where it fouind it.
How can I do this from the command line?
many thanks!