Document comparison is not new today. I remember there were limited command line options in DOS days. It allows you to compare two files (often different versions of same document) for differences.
There are lot of tools which provide you these functionalities. You can use fc.exe command in windows. Or you can check WinDiff from Microsoft as well. But Recently I found a free version of a tool called ExamDiff which allows you to compare two files visually. It has a nice GUI with the support of command line parameters. I had two versions of a SQL scripts with a lengthy code. With ExamDiff I found out the difference in the two within seconds.
You can look for some other File Comparison tools.