Friday, February 10, 2012

How to find difference between two files in ubuntu?

Diff is the command used to find the difference between two text files specified by filename1 and filename2.It is also possible to compare two directories in ubuntu.This can be done when you specify two directories instead of files.The command diff compares only those files with same names.



Open terminal using Applications ---> Accessories ---> Terminal (or) Press Ctrl + Alt + t.

(1). To compare the two specified files and shows the differences between them,deploy the command as follows.

         sudo diff first.txt second.txt




And hit Enter.


Done!

No comments:

Post a Comment