8.1 Working With Files
Syntax
diff [options] file1 file2
Common Options
-b ignore trailing blanks
-i ignore the case of letters
-w ignore <space> and <tab> characters
-e produce an output formatted for use with the editor, ed
-r apply diff recursively through common sub-directories
Examples
For the mon.logins and tues.logins files above, the difference between them is given by:
% diff mon.logins tues.logins
2d1
< bsmith
4a4
> jdoe
7c7
< mschmidt
---
> proy
Note that the output lists the differences as well as in which file the difference exists. Lines in the first file are preceded by "< ", and those in the second file are preceded by "> ".