When comparing files on Linux, there are a bunch of tools available to you, which are covered in separate posts on my blog. This neat trick deserves its own post though -namely converting between upper and lowercase.
Before comparing two text files that have been sorted, duplicates removed with uniq and grepped etc, remember to convert to lower or upper case prior to making final comparison with another file.
tr ‘[:lower:]’ ‘[:upper:]’ <input-file > output-file
My preferred way to compare files isn’t using diff or comm but to use grep… More often than not it gives me the result I want.
grep -Fxv -f first-file second-file
This returns lines in the second file that are not in the first file.
When comparing files, remember to remove any BLANK LINES.