I have 2 files with a list of numbers (telephone numbers).
I\'m looking for a method of listing the numbers in the second file that is not present in the first file.
grep -Fxv -f first-file.txt second-file.txt
Basically looks for all lines in second-file.txt
which don't match any line in first-file.txt
. Might be slow if the files are large.
Also, once you sort the files (Use sort -n
if they are numeric), then comm
should also have worked. What error does it give? Try this:
comm -23 second-file-sorted.txt first-file-sorted.txt