Comparing Files

Say I have two of the same very long configuration files with only minor differences. Is there a way to compare them and print only the differences to screen or to file? This would be very very handy indeed so I assume I can already do it? What command must a use or utility must I obtain?

diff

diff is your friend

man diff

effectively:

diff

will print differences in an offset format

atlas:/home/timoid/sms# diff icqsmsd.conf icqsmsd.conf2
3c3
< logfile = icqsmsd.log
---
> logfile = cqsmsd.log

there are plenty of advanced uses
-d --minimal Try hard to find a smaller set of changes.
-H --speed-large-files Assume large files and many scattered small changes.

those two are the most important for big files and small changes