Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
File and directory comparison tool?

Is there any software available on Ubuntu12.04 to compare two gedit text files for the differences between them. I have two CSS text files with me that i want to compare for the difference.

share|improve this question

marked as duplicate by Takkat, January, jokerdino, Mik, Mitch Sep 20 '12 at 10:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
You can also integrate meld (the most upvoted program in the post above) with gedit webupd8.org/2011/01/how-to-integrate-meld-into-gedit-for.html –  Glutanimate Sep 20 '12 at 9:41

2 Answers 2

up vote 20 down vote accepted

The classical Un*x way of doing that is diff:

diff file1 file2

A more visual way for vim users is to do vimdiff:

vimdiff file1 file2

Finally, there is diffuse:

sudo apt-get install diffuse
diffuse file1 file2

Here is an example diffuse window:

enter image description here

You clearly see the differences between the two text files. Using the blue arrows on the top that go up or down you can move between the differences found. The blue arrows on the top that go left and right can be used to move the text from left to right and the other way round. The icons with two little blue arrows are used to merging the two files.

If you double click, you can directly edit the text.

Just to make life more interesting, you will get an upvote if you guess correctly what is this data in the above picture :-)

share|improve this answer
    
can you please elaborate more on visual way?? –  vipin8169 Sep 20 '12 at 9:41
    
in these commands both file1 and file2 need to be in the same directory or i can give file1path fil2path? –  vipin8169 Sep 20 '12 at 9:43
1  
Sure, you can always add the path. Whenever you need a file argument, you can specify the file with the full or partial path. –  January Sep 20 '12 at 9:49
    
yeah. this diffuse is really awesome, but it won't work for remote access :/ –  vipin8169 Sep 20 '12 at 9:55
1  
Nope. This is a list of people who have estimated the value of Pi, with the respective year and estimate. As for remote access: I usually mount the remotes using sshfs or some other tool like that, so I can work with the remote files as if they were local. Or use rsync. –  January Sep 20 '12 at 10:26

There is Meld Diff Viewer. Meld is a graphical user interface tool for comparing text files and their contents. You can find instructions on how to install and use it here.

There is also the command line tool diff

Diff syntax:

diff first_file_to_compare second_file_to_compare
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.