How do you compare two similar files to check the differences?The obvious answer is Use the diff command in Linux.
The problem is that not everyone is willing to compare files in the Linux terminal. The output of the diff command may confuse some people.
Take the output of this diff command as an example:
There must be a learning curve here. However, if you are using desktop Linux, you can easily compare any differences between the two files using a GUI application.
There are several GUI diff tools available for Linux. In this week’s Linux application focus, I will focus on my favorite tool Meld.
Fusion: Visual Diff and Merge tool for Linux (and Windows)
use melt, You can compare two files side by side. Not only that, you can also modify the file to make corresponding changes. That’s what you want to do in most cases, right?
Meld can also compare directories and show which files are different. It will also show when the file is new or missing.
You can also use Meld for three comparisons.
Three-way file comparison
Graphical side-by-side comparisons are helpful in many situations. If you are a developer, you can use it to understand code patches. Meld also supports version control systems such as Git, Mercury, subversion and many more
The open source Meld tool has the following main functions:
- Perform two-way and three-way difference comparison
- Edit files in place, update differences and comparisons immediately
- Navigate between differences and conflicts
- Visualize global and local differences and mark insertions, changes and conflicts accordingly
- Use regular expression text filtering to ignore certain differences
- Syntax highlighting
- Compare two or three directories to find newly added, missing and changed files
- Exclude some files from comparison
- Support popular version control systems such as Git, Mercurial, Bazaar and SVN
- Support multiple international languages
- Open source GPL v2 license
- Suitable for Linux and Windows
Install Meld on Linux
Meld is a popular application that can be found in the official repositories of most Linux distributions.
Check the software center of your distribution to see if you can use Meld.
Incorporate into the Ubuntu Software Center
Alternatively, you can install Meld using the command-line package manager of the distribution. On Ubuntu, it is available in the Universe repository and can be installed using the apt command:
sudo apt install meld
You can find Meld’s source code in GNOME’s GitLab repository:
I know that most modern open source editors have this feature, but sometimes you just need a simple interface without installing additional components for comparing files. Meld can provide it for you.
Do you use other tools to check the differences between files? Which tool is that? If you have used Meld before, what do you think? The comment section is for you to share your opinions.