• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Source Digit

Source Digit

Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • How To
  • Ubuntu
  • Instagram
  • Blogging
  • Android
  • WordPress
  • +More
    • Cloud Computing
    • Gadgets
    • Social Media
    • Technology
  • Write for Us
Home / How To / How To Check Difference Between Two Files In Linux Ubuntu

How To Check Difference Between Two Files In Linux Ubuntu

By Sourabh / June 12, 2025 Category: How To, Ubuntu

If you want to check difference between two files in Linux or compare 2 files in Linux and print difference, here is the blog post for you.

After reading this tutorial you can easily compare two directories in Linux recursively.

See The Diff Between Two Directories in Linux

Meld is a tool for comparing two or more than two files and directories, and for checking differences between them on screen.

Meld shows differences between two or three files (or two or three directories) and allows you to edit the content – you can move content between them, or edit the files manually.

It is very useful for comparing changes by version control systems.

To install meld on Debian, Ubuntu and Mint system, run the following command:

$ sudo apt install meld         

Once installed open the meld application from terminal (use meld command) or from Ubuntu app dash. Once opened, you can start a new file comparison by selecting the File ▸ New… menu item.

When you compare two files or directories, the application lets you compare two or three text files side-by-side. Differences between the files will be highlighted so that it is easier to see the changes.

On the left and right-hand sides of the meld window, there are various coloured blocks showing the differences between your two files.

Note that each coloured block represents a section that is inserted, deleted, changed or in conflict between your files, depending on the block’s colour used.

When comparing folder or directories, the Meld application uses various colour and text formats telling you how it differed from its corresponding files/folders.

For example when you see normal font, it means that the file/folder is the same across all compared folders.

Similarly, other folder comparison formats used are:

  1. Italics: These files are different across folders, but once text filters are applied, these files become identical.
  2. Blue and bold: It shows modified ones. These files differ between the folders being compared.
  3. Green and bold: New folder or files. This file/folder exists in this folder, but not in the others.
  4. Greyed out text with a line through the middle: Missing ones. This file/folder doesn’t exist in this folder, but does in one of the others.
  5. Bright red with a yellow background and bold: When comparing this file, an error occurred.

You can also use the meld via command line or terminal.

  1. For a two- or three-way file comparison, start Meld with meld file1 file2 or meld file1 file2 file3 respectively.
  2. For a two- or three-way directory comparison, start Meld with meld dir1 dir2 or meld dir1 dir2 dir3.

For more help, use meld –help.

Primary Sidebar

Latest Posts

Delete Directory And Contents Recursively Without Prompt On Linux

Check User Login History In Ubuntu Linux Command Line

Use Locate Command To Find File In Linux Terminal By Name

How To Change Terminal Color In Ubuntu Command Line

How To Run Fsck Manually In Linux To Fix Unexpected Inconsistency

How To Fix Broken Packages On Ubuntu From Terminal

Re Execute The Previous Command In Linux Ubuntu Command Line

How Much RAM Is Needed For Ubuntu PC

How To Find Large Files And Directories In Linux Command Line

How To Use Clear Command History In Linux Terminal

© 2026 Source Digit • Linux, Ubuntu Tutorials & News, Technology, Gadgets & Gizmos

  • Home
  • About
  • Privacy Policy
  • Terms & Conditions
  • Contact Us
  • Sitemap