DIFFOSCOPE(1)
πΈ DIFFOSCOPE(1) πΈ
okay bestie, welcome to the User Commands section, because we're reading diffoscope(1) together and it's gonna be a whole journey π
β¨ NAME β¨
diffoscope β in-depth comparison of files, archives, and directories
Like, it goes deep. Not surface-level. It's giving forensic investigator energy. π
π SYNOPSIS π
diffoscope --help
diffoscope [OPTIONS] [--json output_diff] path1 path2
diffoscope [OPTIONS] diff
diffoscope [OPTIONS] < diff
""
(yes that last little "" line is really in there, we don't question it, we respect it π)
π DESCRIPTION π
So. diffoscope will try to get to the bottom of what makes files or directories different. It's literally not going to stop until it knows. It will recursively unpack archives of many kinds and transform various binary formats into more human-readable form to compare them. Comparing two tarballs? An ISO image? A PDF? Same energy, same ease, no cap. π¦
It can be scripted through error codes, and a report can be produced with the detected differences. The report can be text or HTML. And when no type of report has been selected, diffoscope defaults to writing a text report on the standard output. Iconic default behaviour, honestly.
diffoscope was initially started by the "reproducible builds" Debian project and is now being developed as part of the (wider) βReproducible Buildsβ initiative <https://reproducible-builds.org>. Its whole purpose is to be able to quickly understand why two builds of the same package produce different outputs. And plot twist: diffoscope was previously named debbindiff. Glow-up era. π
See the COMMAND-LINE EXAMPLES section further below to get you started, as well as more detailed explanations of all the command-line options. The same information is also available in /usr/share/doc/diffoscope/README.rst or similar.
path1β First file or directory to compare.path2β Second file or directory to compare.
π οΈ options: π οΈ
--debugβ Display debug messages--pdbβ Open the Pythonpdbdebugger in case of crashes--status-fd FDβ Send machine-readable status to file descriptorFD--progress,--no-progressβ Show an approximate progress bar. Default: yes if stdin is a tty, otherwise no.--no-default-limitsβ Disable most default output limits and diff calculation limits.--load-existing-diff INPUT_FILEβ Load existing diff from file. Specify"-"to read a diffoscope diff from stdin.
π output types: π
--text OUTPUT_FILEβ Write plain text output to given file (use-for stdout)--text-color WHENβ When to output color diff.WHENis one of{never, auto, always}. Default:auto, meaning yes if the output is a terminal, otherwise no.--output-emptyβ If there was no difference, then output an empty diff for each output type that was specified. In--textoutput, an empty file is written.--html OUTPUT_FILEβ Write HTML report to given file (use-for stdout)--html-dir OUTPUT_DIRβ Write multi-file HTML report to given directory--css URLβ Link to an extra CSS for the HTML report--jquery URLβ URL link to jQuery, for--htmland--html-diroutput. If this is a non-existent relative URL,diffoscopewill create a symlink to a system installation. (Paths searched:/usr/share/javascript/jquery/jquery.js.) If not given,--htmloutput will not use JS but--htmldirwill if it can be found; give"disable"to disable JS on all outputs.--json OUTPUT_FILEβ Write JSON text output to given file (use-for stdout)--markdown OUTPUT_FILEβ Write Markdown text output to given file (use-for stdout)--restructured-text OUTPUT_FILEβ Write RsT text output to given file (use-for stdout)--difftool TOOLβ Compare differences one-by-one using the specified external command similar togit-difftool(1)--profile [OUTPUT_FILE]β Write profiling info to given file (use-for stdout)
π output limits: π
--diff-context LINESβ Lines of unified diff context to show. (default:7)--max-text-report-size BYTESβ Maximum bytes written in--textreport. (0to disable, default:0)--max-report-size BYTESβ Maximum bytes of a report in a given format, across all of its pages. Note that some formats, such as--html, may be restricted by even smaller limits such as--max-page-size. (0to disable, default:41943040)--max-diff-block-lines LINESβ Maximum number of lines output per unified-diff block, across all pages. (0to disable, default:1024)--max-page-size BYTESβ Maximum bytes of the top-level (--html-dir) or sole (--html) page. (default:41943040, remains in effect even with--no-default-limits)--max-page-diff-block-lines LINESβ Maximum number of lines output per unified-diff block on the top-level (--html-dir) or sole (--html) page, before spilling it into a child page (--html-dir) or skipping the rest of the diff block. (default:128, remains in effect even with--no-default-limits)
π¬ diff calculation: π¬
--new-fileβ Treat absent files as empty--exclude GLOB_PATTERNβ Exclude files whose names (including any directory part) matchGLOB_PATTERN. Use this option to ignore files based on their names.--exclude-command REGEX_PATTERNβ Exclude commands that matchREGEX_PATTERN. For example'^readelf.*\s--debug-dump=info'and'^radare2.*'can take a long time and differences here are likely secondary differences caused by something represented elsewhere. Use this option to disable commands that use a lot of resources.--exclude-directory-metadata {auto,yes,no,recursive}β Exclude directory metadata. Useful if comparing files whose filesystem-level metadata is not intended to be distributed to other systems. This is true for most distributions package builders, but not true for the output of commands such asmake install. Metadata of archive members remain un-excluded except if"recursive"choice is set. Use this option to ignore permissions, timestamps, xattrs etc. Default:'no'if comparing two directories, else'yes'. Note that"file"metadata is actually a property of its containing directory and is not relevant when distributing the file across systems.--extended-filesystem-attributes,--no-extended-filesystem-attributesβ Check potentially-expensive filesystem extended attributes such as POSIX ACLs,lsattr(1)/chattr(1)attributes etc. (default:False)--diff-mask REGEX_PATTERNβ Replace/unify substrings that match regular expressionREGEX_PATTERNfrom output strings before applying diff. For example, to filter out a version number or changed path.--fuzzy-threshold FUZZY_THRESHOLDβ Threshold for fuzzy-matching (0to disable,110is default,400is high fuzziness)--tool-prefix-binutils PREFIXβ Prefix for binutils program names, e.g."aarch64-linux-gnu-"for a foreign-arch binary or"g"if you're on a non-GNU system.--max-diff-input-lines LINESβ Maximum number of lines fed todiff(1)(0to disable, default:4194304)--max-container-depth DEPTHβ Maximum depth to recurse into containers. (Cannot be disabled for security reasons, default:50)--timeout SECONDSβ Best-effort attempt at a global timeout in seconds. If enabled,diffoscopewill not recurse into any further sub-archives after X seconds of total execution time. (default: no timeout)[experimental]--max-diff-block-lines-saved LINESβ Maximum number of lines saved per diff block. Most users should not need this, unless you run out of memory. This truncatesdiff(1)output before emitting it in a report, and affects all types of output, including--textand--json. (0to disable, default:0)--use-dbgsym WHENβ When to automatically use corresponding-dbgsympackages when comparing.debfiles.WHENis one of{no, auto, yes}. Default:auto, meaning yes if two.changesor.buildinfofiles are specified, otherwise no.--force-detailsβ Force recursing into the depths of file formats even if files have the same content, only really useful for debuggingdiffoscope. Default:False
π‘ information commands: π‘
--help,-hβ Show this help and exit--versionβ Show program's version number and exit--list-tools [DISTRO]β Show external tools required and exit.DISTROcan be one of{arch, debian, FreeBSD, guix}. If specified, the output will list packages in that distribution that satisfy these dependencies.--list-debian-substvarsβ List packages needed for Debian in'substvar'format.--list-missing-tools [DISTRO]β Show missing external tools and exit.DISTROcan be one of{arch, debian, FreeBSD, guix}. If specified, the output will list packages in that distribution that satisfy these dependencies.
okay that's part one bestie, hold on, there's more coming πβ¨
- Android APK files, Android boot images, Android package resource table (ARSC), Apple Xcode mobile provisioning files,
ar(1)archives, asar archives, ASM Function, Berkeley DB database files, bzip2 archives, character/block devices, ColorSync colour profiles (.icc), Coreboot CBFS filesystem images, cpio archives, Dalvik.dexfiles, Debian.buildinfofiles, Debian.changesfiles, 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.hifiles, 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.classfiles, Java.jmodmodules, 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, LZMA compressed files, macOS binaries, Microsoft Windows icon files, Microsoft Word.docxfiles, Mono 'Portable Executable' files, Mozilla-optimized.ZIParchives, Multimedia metadata, nar files, NuGet packages, OCaml interface files, Ogg Vorbis audio files, OpenOffice.odtfiles, 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.pycfiles, 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.
like. that's the list. that's the whole list. it's giving archive gremlin and honestly? obsessed. π¦
- diffoscope homepage:
<https://diffoscope.org/> - bugs/issues:
<https://salsa.debian.org/reproducible-builds/diffoscope/issues>
π EXIT STATUS π
okay so the exit status is literally the whole personality of this tool, bestie:
0β the inputs are the same. slay.1β the inputs are different. π2β trouble. something went wrong. we do not perceive it. π
periodt. that's it. those are the three.
β¨ COMMAND-LINE EXAMPLES β¨
π comparing two files and getting an HTML report
wanna compare two files in-depth and produce an HTML report? run something like this:
$ diffoscope --html output.html build1.changes build2.changes
and then β get this β diffoscope will exit with 0 if there's no differences and 1 if there are. so your shell scripts can just know. iconic behaviour fr fr. π
π getting all possible options
to get all possible options, run:
$ diffoscope --help
π§ if you have enough RAM (the speed hack)
if you have enough RAM, you can improve performance by running:
$ TMPDIR=/run/shm diffoscope very-big-input-0/ very-big-input-1/
by default this allowed to use up half of RAM; for more, add something like:
tmpfs /run/shm tmpfs size=80% 0 0
to your /etc/fstab; see man mount for details. π«Ά
ngl if you don't have the RAM, do NOT do this. the TMPDIR vibe check is real.
πΈ EXTERNAL DEPENDENCIES πΈ
diffoscope requires Python 3 and the following modules available on PyPI: libarchive-c <https://pypi.python.org/pypi/libarchive-c>, python-magic <https://pypi.python.org/pypi/python-magic>.
the various comparators rely on external commands being available. to get a list of them, please run:
$ diffoscope --list-tools
like, it'll tell you what it needs. no guessing, no cap. β¨
π CONTRIBUTORS π
the literal main characters of this project, in the order the page says them:
- Lunar
- Reiner Herrmann
- Chris Lamb
- Mattia Rizzolo
- Ximin Luo
- Helmut Grohne
- Holger Levsen
- Daniel Kahn Gillmor
- Paul Gevers
- Peter De Wachter
- Yasushi SHOJI
- Clemens Lang
- Ed Maste
- Joachim Breitner
- Mike McQuaid
- Baptiste Daroussin
- Levente Polyak
every single one. we love a credited contributor moment. π«Ά
π CONTACT π
the preferred way to report bugs about diffoscope, as well as suggest fixes and requests for improvements, is to submit reports to the issue tracker at:
<https://salsa.debian.org/reproducible-builds/diffoscope/issues>
for more instructions, see CONTRIBUTING.rst in this directory.
join the users and developers mailing-list: <<https://lists.reproducible-builds.org/listinfo/diffoscope>>
diffoscope website is at <<https://diffoscope.org/>>
π LICENSE π
diffoscope is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
diffoscope is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details.
you should have received a copy of the GNU General Public License along with diffoscope. if not, see <<https://www.gnu.org/licenses/>>.
fr fr read the license. it's not a vibe, it's a legally binding vibe. π
π SEE ALSO π
okay bestie that's the whole page π this was diffoscope 332, dated September 2026, and it's page DIFFOSCOPE(1) in section 1. go forth and diff. no cap. πβ¨π¦
π¦ where this page comes from
- fedora 44: diffoscope 332-1.fc44 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms