which does what I need it to do, but for only two files. I want to make it so that I can have multiple files (for example 30) and the code will return only the items that are in every single one of those files and ignore the ones that are not.
For simplicity of a big example, say I have 30 files, and all of them have the words "one, two, three, four, five" but 10 of them have additional words of "six, seven, eight, nine, ten". I want the output of my code to be
awk '
!f[FILENAME] {for (i in t) if (!a) delete t ; delete a; f[FILENAME]=FILENAME}
NR==FNR {t[$0]=$0}
{a[$0]=$0}
END { for (i in t) if (!a) delete t; for (i in t) print i}
' file*
awk '
!f[FILENAME] {for (i in t) if (!a) {t=""} ;
for (i in a) a="";
f[FILENAME]=FILENAME
}
NR==FNR {t[$0]=$0}
{a[$0]=$0}
END { for (i in t) if (!a) t=""; for (i in t) {if (t) print i}}
' file*