- publishing free software manuals
Comparing and Merging Files with GNU diff and patch
by David MacKenzie, Paul Eggert, and Richard Stallman
Paperback (6"x9"), 120 pages
ISBN 0954161750
RRP £12.95 ($19.95)

"Well packaged... the quality of information is excellent" --- Linux User and Developer Magazine (Issue 36, Feb 2004) Get a printed copy>>>

1.6 Summarizing Which Files Differ

When you only want to find out whether files are different, and you don't care what the differences are, you can use the summary output format. In this format, instead of showing the differences between the files, diff simply reports whether files differ. The -q and --brief options select this output format.

This format is especially useful when comparing the contents of two directories. It is also much faster than doing the normal line by line comparisons, because diff can stop analyzing the files as soon as it knows that there are any differences.

You can also get a brief indication of whether two files differ by using cmp. For files that are identical, cmp produces no output. When the files differ, by default, cmp outputs the byte and line number where the first difference occurs. You can use the -s option to suppress that information, so that cmp produces no output and reports whether the files differ using only its exit status (see section 12 Invoking cmp).

Unlike diff, cmp cannot compare directories; it can only compare two files.

ISBN 0954161750Comparing and Merging Files with GNU diff and patchSee the print edition