My advice is to sort the files just-in-time using the shell:
comm <(sort fileA.txt) <(sort fileB.txt)
Re:The most surprising Unix programs
by nunoferreira on Sunday March 15, 2020 @08:54AM
(#22583200)
Absolutely! From my experience I only use with listings from the same source with the same sort tool (mostly unix sort).
This may seem obvious, but there are many tiny ways that sorts can differ between locales, operating systems and programs (e.g. Excel), especially when dealing with Unicode. It may look the same 99% of the time, and you may not realize until later that you’ve accidentally filtered out values.