I have 100 files containing 3 columns and different no. of rows. All three columns contain repeating elements. I want to find the common elements among all 100 files. The files look like:
1.txt
5901 5902 8229
5901 5902 17481
5901 5902 27561
5929 5930 12875
2.txt
5901 5902 8229
5929 5930 12875
and so on. Code which I am trying to use is as for ((i=0;i<=100;i++)) do comm -12 file-"$i".txt file-"$((i+1))".txt > common-element-"$i".txt done
I have used comm command but that was only for 2 files. I have 100 such files.