For sorted files of single items, you can use the "comm" command as well. I will use it at work using Cygwin to compare inventory list from video devices. It is one of the core-utils so you should have it. You could of course use: "comm <(sort file1) <(sort file2)". In the output: Column 1 contains files unique to file1, Column 2 contains items uniq to file2 and Column 3 contains items common to both. You can suppress any column by including the column number as an option:
comm -23 <(sort file1) <(sort file2)
will print the items unique to file1. The other columns 2 & 3 are suppressed.
If you have two lists and need to verify that the items in list1 aren't in list2, you could use "grep -f file1 file2".
Refer to the manpages for comm and grep for all the options.
|