Fast way of comparing lines in 2 files?

  bash, python

I have two large files (sets of filenames). Roughly 30.000 lines in each file. I am trying to find a fast way of finding lines in file1 that are not present in file2.

For example, if this is file1:

A=1
B=2
C=3

And this is file2:

A=10
B=20
C=30
D=5

Then my result/output should be:

D=5

Source: Python Questions

LEAVE A COMMENT