A modern diff utility

Command Line – diffoscope

© Lead Image © Vlad Kochelaevskiy, 123RF.com

© Lead Image © Vlad Kochelaevskiy, 123RF.com

Article from Issue 240/2020
Author(s):

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

The first command in Unix-like systems for comparing files and directories was diff. Originally written by Douglas McIlroy and first appearing in Unix 5th Edition in 1974, diff rapidly became an essential programming tool. Today, the original command is still available, and most programming languages have their own versions of diff. However, diff and its derivatives generally have one limitation: With few exceptions, most of them work only with plain text or markup languages like HTML. A new variation called diffoscope [1], which was released in mid-2020, brings a new level of functionality to file comparison.

Diffoscope is developed primarily by Debian's Reproducible Builds project [2], which aims to increase the robustness and security of Debian packages by ensuring that they always build the same way. Given Debian's nearly 60,000 packages and the variety of hardware available, this is no small task, especially considering that small errors in code can be hard to trace. Diffoscope was written to make this task easier by quickly tracking down differences between two files that are supposed to be identical but perform differently. As a side effect, diffoscope provides a modern diff utility that works across most programing languages and brings the power of diff to desktop users and non-programmers, especially writers who wish to compare drafts. Already, diffoscope supports over 60 binary formats that range from files and filesystems to audio and text files, including MS Word, LibreOffice Writer, and PDF (Table 1). And more seem likely to follow.

Diffoscope's basic command structure is:

[...]

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

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

  • Make the Most of Diffoscope

    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.

  • 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 – diff and merge

    Diff and merge: They're not just for developers.

  • Command Line: Diffutils

    The Diffutils tool set helps you compare text files, discover and display the differences between files, and even automatically synchronize files.

  • 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.

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