Comparing files with diffoscope

Spot the Difference

Article from Issue 280/2024
Author(s):

Diffoscope finds all the differences between files or folders, but at the price of verbosity. We show you how to focus diffoscope on what you want to know.

Diffoscope [1] is a Python 3 command-line tool that shows, with many more details than you might imagine, all the possible differences between two files, folders, or file archives in TAR, ISO, or other formats. In TAR, ISO, and the others, diffoscope can browse the full internal hierarchy of those containers to look at every file they contain.

The basic features and most common uses of diffoscope were previously explained by Bruce Byfield in Linux Magazine [2]. After a brief recap of those features, I will discuss what I consider a limitation of this tool for non-programmers and then illustrate a general method to overcome that limitation – allowing you to much more quickly exploit this great tool's potential.

Diffoscope's Main Features

The full diffoscope package can handle almost every file format in existence, if the right third-party tools are available in your system. A "minimal" version of the package is also available, and as far as I can tell should be more than adequate for the great majority of users. When browsing folders or archives, diffoscope compares files with the same or similar names in the same subfolder. If there is no other way to find differences between files and display them, it falls back on "hexdump comparison" (i.e., comparing the two files byte by byte and showing differences in byte values).

[...]

Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • File Comparison

    With support for more than 60 file formats, diffoscope extends the power of diff beyond the plain text or HTML file.

  • Free Writing Tools

    Some tools designed for programming can also be very helpful for writing fiction. A few to look at include personal wikis, random word generators, and version control tools.

  • Command Line – Disposable VMs

    Debvm lets you quickly create a temporary virtual machine with a small memory footprint, ideal for testing scripts or mixing repositories.

  • ExifTool and jExifToolGUI

    ExifTool lets you modify and analyze metadata in multimedia files from the command line, but its comprehensive feature set results in a lengthy learning curve. Luckily, jExiftoolGUI offers an intuitive interface that makes using ExifTool easier, even for less experienced users.

  • Metadata Cleanup Tools

    Digital camera images often reveal personal information embedded in metadata. Several Linux tools let you remove unwanted metadata to help preserve your privacy.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News