diffoscope tries to get to the bottom of what makes files or directories different. It will recursively unpack archives of many kinds and transform various binary formats into more human-readable form to compare them. It can compare two tarballs, ISO images, or PDF just as easily.
Latest release: 283 (08 Nov 2024)
You can try it now using Docker:
echo foo > file1
echo bar > file2
docker run --rm -t -w $(pwd) -v $(pwd):$(pwd):ro \
registry.salsa.debian.org/reproducible-builds/diffoscope file1 file2
… or try it on try.diffoscope.org!
(RSS)
Firefox extensions compared (HTML output)
Debian packages compared (text output)
… and more examples on tests.reproducible-builds.org. You can also view an demonstration interactive shell session (220K).
Command-line interface
Text and HTML ouput
File formats supported include: Android APK files, Android boot images, Android package resource table (ARSC), Apple Xcode mobile provisioning files, ar(1) archives, ASM Function, Berkeley DB database files, bzip2 archives, character/block devices, ColorSync colour profiles (.icc), Coreboot CBFS filesystem images, cpio archives, Dalvik .dex files, Debian .buildinfo files, Debian .changes files, Debian source packages (.dsc), Device Tree Compiler blob files, directories, ELF binaries, ext2/ext3/ext4/btrfs/fat filesystems, eXtensible ARchive files, Filesystem image, Flattened Image Tree blob files, FreeDesktop Fontconfig cache files, FreePascal files (.ppu), Gettext message catalogues, GHC Haskell .hi files, GIF image files, Git repositories, GNU R database files (.rdb), GNU R Rscript files (.rds), Gnumeric spreadsheets, GPG keybox databases, Gzipped files, Hierarchical Data Format database, HTML files (.html), ISO 9660 CD images, Java .class files, Java .jmod modules, JavaScript files, JPEG images, JSON files, Linux kernel images, LLVM IR bitcode files, local (UNIX domain) sockets and named pipes (FIFOs), LZ4 compressed files, lzip compressed files, macOS binaries, Microsoft Windows icon files, Microsoft Word docx files, Mono ‘Portable Executable’ files, Mozilla-optimized .ZIP archives, Multimedia metadata, OCaml interface files, Ogg Vorbis audio files, OpenOffice odt files, OpenSSH public keys, OpenWRT package archives (.ipk), PDF documents, PE32 files, PGP signatures, PGP signed/encrypted messages, PNG images, PostScript documents, Public Key Cryptography Standards (PKCS) files (version #7), Python .pyc files, RPM archives, Rust object files (.deflate), Sphinx inventory files, SQLite databases, SquashFS filesystems, symlinks, tape archives (.tar), tcpdump capture files (.pcap), text files, TrueType font files, U-Boot legacy image files, UKI image (.efi), WebAssembly binary module, XML binary schemas (.xsb), XML files, XMLB files, XZ compressed files, ZIP archives and Zstandard compressed files.
Fallback on hexdump comparison
Fuzzy-matching to handle renamings
… and many more!
Via pip
:
pip install diffoscope
Note: You might still want to install Python modules from tlsh and rpm and other external tools to get more meaningful results. Use diffoscope --list-tools
to get the full list.
On Debian and derivatives:
apt install diffoscope
Via Docker:
docker run --rm -t -w $(pwd) -v $(pwd):$(pwd):ro registry.salsa.debian.org/reproducible-builds/diffoscope
On Fedora based systems:
dnf install diffoscope
On Gentoo based systems:
emerge dev-util/diffoscope
On openSUSE:
zypper in diffoscope
On Arch Linux:
pacman -S diffoscope
On FreeBSD based systems:
pkg install py38-diffoscope
On NixOS/nixpkgs:nix-shell -p diffoscope
On Homebrew:brew install diffoscope
Through Git:
git clone https://salsa.debian.org/reproducible-builds/diffoscope.git
diffoscope is developed within the “Reproducible builds” effort.
#reproducible-builds
and/or #debian-reproducible
on OFTCExtending diffoscope to support new formats is quite straightforward in most cases. It also has a comprehensive test suite. Patches welcome!
pkg-diff.sh
from Open Build Service build-compare
diffoscope is free software licensed under the GNU General Public License version 3 or later.
Akihiro Suda, Alexis Murzeau, Alyssa Ross, anthraxx, Balint Reczey, Baptiste Daroussin, Ben Hutchings, Benjamin Peterson, beuc@beuc.net, Brandon Maier, Brent Spillner, Brett Smith, Ceridwen, Chris Lamb, Christopher Baines, Clemens Lang, Conrad Ratschan, Daniel Fullmer, Daniel Kahn Gillmor, Daniel Shahaf, Dhole, Dimitrios Apostolou, Ed Maste, Efraim Flashner, Eli Schwartz, Emanuel Bronshtein, Esa Peuha, FC (Fay) Stegerman, Felix Yan, Frazer Clews, Gianfranco Costamagna, Graham Christensen, Greg Chabala, Guangyuan Yang, Hans-Christoph Steiner, Helmut Grohne, Holger Levsen, HW42, James Addison, James Clarke, Jean-Romain Garnier, Jelle van der Waa, Jelmer Vernooij, Joachim Breitner, Juliana Oliveira, Jérémy Bobbio, Keith Smiley, klemens, Marc Herbert, Marek Marczykowski-Górecki, Maria Glukhova, Marius Gedminas, Martin Abente Lahaye, Mattia Rizzolo, Michael Osipov, Michel Messerschmidt, Mike Hommey, Mike McQuaid, Milena Boselli Rosa, Paul Gevers, Paul Spooren, Paul Wise, Peter De Wachter, Rainer Müller, Reiner Herrmann, Ricardo Gaviria, Roland Clobus, Sam James, Santiago Torres Arias, Santiago Torres-Arias, Satyam Zode, Sergei Trofimovich, Seth Michael Larson, Vagrant Cascadian, Vekhir, Vibhu, Will Thompson, Xavier Briand, Ximin Luo, Yasushi SHOJI, Zachary T Welch, and Zbigniew Jędrzejewski-Szmek.