28.7 diff for Very Long Files: bdiffThe diff command has trouble comparing very long files. Its -h option does a half-hearted and fast job, but it can miss changes in some cases. System V users have an alternative: bdiff . It ignores lines common to the beginning of both files, splits the remainder of each file into chunks, and runs diff on corresponding segments. (BSD users can probably make a shell script that does this, more or less. I haven't tried, though.) bdiff also adjusts the line numbers for each chunk to make it look like one diff did the whole job. The good part of this is that bdiff will find all the differences. The bad part is that it might find "differences" that really aren't differences at all. This extra output is usually caused by uneven-length files. Here's an example of two files that aren't quite too long for the regular diff -it finds the single difference correctly. But bdiff finds another "difference" that isn't really a difference: % Even with that wart, sometimes you can't get along without bdiff . - |
|