LinuxCommandLibrary

diffoscope

deep recursive file comparison tool

TLDR

Compare two files

$ diffoscope [file1] [file2]
copy
Compare and output HTML report
$ diffoscope --html [report.html] [file1] [file2]
copy
Compare with limited depth
$ diffoscope --max-diff-block-lines [100] [file1] [file2]
copy
Compare directories recursively
$ diffoscope [dir1] [dir2]
copy
Output JSON report
$ diffoscope --json [report.json] [file1] [file2]
copy
Compare Debian packages
$ diffoscope [package1.deb] [package2.deb]
copy
Exclude specific file patterns
$ diffoscope --exclude "[*.pyc]" [dir1] [dir2]
copy

SYNOPSIS

diffoscope [options] path1 path2

DESCRIPTION

diffoscope performs deep comparison of files, recursively unpacking archives and examining contents. Unlike simple diff, it understands file formats and shows meaningful differences inside compressed files, images, binaries, and more.
The tool supports hundreds of file formats: archives (tar, zip, deb, rpm), binaries (ELF, PE), images (PNG, JPEG), documents (PDF), and many others. It uses specialized tools to decode each format before comparison.
diffoscope was created to debug reproducible build issues, helping identify why two builds of the same source produce different binaries. Output can be terminal text, HTML for web viewing, or JSON for programmatic processing.

PARAMETERS

--html file

Write HTML report to file.
--text file
Write text report to file.
--json file
Write JSON report to file.
--max-diff-block-lines n
Maximum lines per diff block.
--max-report-size bytes
Maximum report size.
--exclude pattern
Exclude files matching pattern.
--exclude-directory-metadata
Ignore directory metadata differences.
--fuzzy-threshold n
Fuzzy matching threshold (0-400).
--new-file
Treat absent files as empty.
--no-default-limits
Remove default size limits.
--diff-tool tool
External diff tool to use.

CAVEATS

Full functionality requires many external tools (binutils, unzip, etc.). Large files or deep archives may be slow to process. Some proprietary formats aren't supported. Memory usage can be high for large comparisons.

HISTORY

diffoscope was created by the Reproducible Builds project, specifically by Lunar and others, starting in 2014. Originally named "debbindiff" for Debian package comparison, it was renamed and generalized. The tool is central to the reproducible builds effort, helping developers understand why builds differ and fix the sources of non-determinism.

SEE ALSO

diff(1), cmp(1), reprotest(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community