Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
I think you should be able to pick your answer out of some combination of these commands.
$ head xF*
==> xF1.txt <==
uid=1
uid=2
uid=3
uid=4
uid=5
uid=6
==> xF2.txt <==
uid=4
uid=3
uid=2
uid=1
$ sort -o tmp1.txt xF1.txt && sort -o tmp2.txt xF2.txt
$ diff tmp1.txt tmp2.txt
5,6d4
< uid=5
< uid=6
$ comm -12 tmp1.txt tmp2.txt # lines common to both files
uid=1
uid=2
uid=3
uid=4
$ comm -13 tmp1.txt tmp2.txt # lines only in file 2 (none)
$ comm -23 tmp1.txt tmp2.txt # lines only in file 1
uid=5
uid=6
$ comm -3 tmp1.txt tmp2.txt # lines unique in file 1 OR file 2 (not in both)
uid=5
uid=6
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953