Bash: Comparison of two files having different file size

bashdiff()

I have 2 files with me having content like:

file1:

a
b
c
e
g
s

and file2

s
a
b
c

I want to compare contents of the file, that what which letters are NOT present in other file, and which Are present in other file. problem is that the size of the files is different. if it would have been same,then it wont be an issue and simple DIFF would give me the comparison.

if i compare file1 and file 2, i need to get the difference like this, following are not present in file 2:

e
g

Best Answer

Then how's

sort f1 > f1.sort
sort f2 > f2.sort
diff f1.sort f2.sort
4,5d3
< e
< g

That tells you that e and g are present only in f1.