Meld is considered as one of the best difference viewer application, it views differences between files and directories. It makes it easy to isolate and merge these differences. It is dead-simple to compare two file and edit them in a place, you can also compare three file and folders. As this tool is very useful for programmers so it is not just limited to the simple files comparison, it also lets you browse and view a working copy from some commonly used version control systems like CVS, Subversion and others.
To install it in Ubuntu, just open the terminal and run the following command :
sudo apt-get install meld
It will be installed instantly, you can launch it from Applications > Programming > Meld Diff Viewer.
To compare files, choose File > New and select the File Comparison tab. Here you will get option, compare two or three files. Browse and select the files you wish to compare and click OK.
Its shows the differences by highlighting the respective lines in the both files.
Similarly, you can launch the folder comparisons from Files > New and then choosing Directory Comparison tab, Version Control Browser lets you browse in version controls. Enjoy!