We have all used diff
or cmp
to compare two files
cmp
is silent … it only tells you if there is a difference
diff
has a horrendous output intended to be computer readable, and it suffers from the issue of one extra line lleading to every subsequent pair of lines being flaggd as different.
There is a better way. meld
is like diff
with a gui. It can compare
- 2 or 3 files
- 2 or 3 folders
- a file with its copy in a
git
repository
You can installmeld
as a package from Debian repository, ie
apt install meld
is all that is required.
`Meld has a startup entry in the Applications Menu. It is in the Development section. Alternatively you can start it from the command line
meld
or
meld file1 file2
there are other options see later
If you start meld without a filename you get
A rather plain window.
If you click on
File
you can enter 2 filenames and when you hit Compare
you getYou see 2 versions of a file ( xvpng.c) in different directories.
One has some extra
#include
statements.
You can also compare 2 Folders. Click on Folders
and enter 2 folder names , click compare and you get
There you can see the missing files in the right hand folder are struck out
Lastly, if you use git
, you can compare one file with its copy in the git repository
You can see the and the actual file on the right.
I have not yet committed some changes to git.
`Meld can also do other things, such as merge files.
Here is the start of its man page
Meld is not solely for programmers. You can compare any text files, eg data files, documents.
Give it a try. It works for me.