find common elements in >2 files
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have three files as shown below file1.txt "aba" 0 0 "aba" 0 0 1 "abc" 0 1 "abd" 1 1 "xxx" 0 0 file2.txt "xyz" 0 0 "aba" 0 0 0 0 "aba" 0 0 0 1 "xxx" 0 0 "abc" 1 1 file3.txt "xyx" 0 0 "aba" 0 0 "aba" 0 1 0 "xxx" 0 0 0 1 "abc" 1 1 I want to find the similar elements in all the three files based on first two columns. To find similar elements in two files i have used something like awk 'FNR==NR{a[$1,$2]++;next}a[$1,$2]' file1.txt file2.txt But, how can we find similar elements in all the files, when the input files are more than 2? Can anyone