Tool for diffing large files

When I use "diff" to find the difference between two large data files,

diff A.txt B.txt > dif.info

it is output:

diff:memory exhausted

or add the argument "-H"

diff -H A.txt B.txt > dif.info

it also got the same message:

diff:memory exhausted

The size are about 1.5GB. How to compare large files ? Any other tools or solutions ? my PC: Redhat5.4 OS, 4GB memory. Thanks.


One idea would be to use split on both files and compare each chunk. It will not be exactly the same, but it all depends on what you are looking for.


try installing the textproc/2bsd-diff port

http://www.freshports.org/textproc/2bsd-diff/