A modern diff utility

Command Line – diffoscope

© Lead Image © Vlad Kochelaevskiy, 123RF.com

© Lead Image © Vlad Kochelaevskiy, 123RF.com

Article from Issue 240/2020

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

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

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

  • BeeDiff

    BeeDiff compares two files and quickly displays the differences in a convenient desktop GUI interface.

  • Dwdiff Shows Changes Word for Word

    Version 1.3 of dwdiff, a free front-end for the Unix diff program has just been released and is now licensed under the GPLv3.

comments powered by Disqus

Direct Download

Read full article as PDF: