I have one text file containing 78 numbers, and then I have another text file that contains 63 numbers that were pulled from the first file. Therefore, there are 15 numbers in text1 that doesn't exist in text2. How can I find out which ones these are?
I've tried commands such as "sdiff text1 text2", and cannot find these specific 15 numbers for the life of me. I'm sure it's simple, but I'm obviously missing it.
Use the
comm
utility.E.g., in
bash
:comm
requires sorted input, hence the process substitutions.comm
outputs 3 columns: lines only in file 1, lines only in file2, lines in both files.-23
suppresses columns 2 and 3, i.e., the command only outputs lines exclusive to filetextfile1
.