File comparison based on contents

Hi

I have 2 files
1.del
----

1,2,3,4,5
1,2,3,4,4
1,1,1,1,2

2.del
----

1,2,3,4,5
1,
1,2,3,4,4
1,1,1,1,2

I need to compare the above two files in unix, as in the output should only tell the difference in contents as I should get only the line
1 ( from 2.del) , rest all lines are present in the both files.
I tried by fetching line by line and comparing in the second file, but its taking a huge time. I have the file size in GB's
Please advise

if the files are in sorted order please use

comm

and

diff 

commands . please go through the man page for more details.

1 Like

Thanks for the quick reply.
Can you explain a bit more if the files were in this condition
1.del
----

1,2,3,4,5
1,2,3,4,4
1,1,1,1,2

2.del
-----

1,2,3,4,5
1,
1,2,3,4,3
1,2,3,4,4
1,1,1,1,2

and i need only the discrepant rows like
1
1,2,3,4,3 ( The rest all contents are present in some where of the file's). Thanks in advance.

PLEASE use code tags as demanded by forum rules!

Why don't you do as i150371485 proposed: read the cited man pages and give it a shot on your sample files? I promise: you will find the discrepant rows.

Sorry abt the notations.
I will work on this ..