Compare two files in UNIX

Hi,

I have two files

File1 Contents:
abc
dcf
sdc

File2 Contents:
dcf
sdc
erg

Now my program should return the contents existing in File1 but not in File2. In this case output shoud be "abc" as abc is not available in File 2. It should not return "erg" by saying it is existing in File2 and not in File1.
Only File1 Contents not existing in File2 should be displayed. Is there any command to solve this.

Appreciate you assistance in advance...

See if this works for you:

egrep -v -f File2 File1

Thanks a bunch. It worked.

awk 'NR==FNR{a[$1]++;next} !a[$1]' file2 file1
 
comm -23 File1 File2