diffoscope man page

diffoscope ā€” in-depth comparison of files, archives, and directories


diffoscope --help
diffoscope [OPTIONS] [--json output_diff] path1 path2
diffoscope [OPTIONS] diff
diffoscope [OPTIONS] < diff


usage: main.py [--debug] [--debugger] [--status-fd FD] [--progress]

[--no-default-limits] [--text OUTPUT_FILE] [--text-color WHEN] [--output-empty] [--html OUTPUT_FILE] [--html-dir OUTPUT_DIR] [--css URL] [--jquery URL] [--json OUTPUT_FILE] [--markdown OUTPUT_FILE] [--restructured-text OUTPUT_FILE] [--profile OUTPUT_FILE] [--max-text-report-size BYTES] [--max-report-size BYTES] [--max-diff-block-lines LINES] [--max-page-size BYTES] [--max-page-size-child BYTES] [--max-page-diff-block-lines LINES] [--new-file] [--exclude GLOB_PATTERN] [--exclude-command REGEX_PATTERN] [--exclude-directory-metadata] [--fuzzy-threshold FUZZY_THRESHOLD] [--tool-prefix-binutils PREFIX] [--max-diff-input-lines LINES] [--max-container-depth DEPTH] [--max-diff-block-lines-saved LINES] [--force-details] [--help] [--version] [--list-tools [DISTRO]] [--list-debian-substvars] [path1] [path2]

Calculate differences between two files or directories

positional arguments


First file or directory to compare. If omitted, tries to read a diffoscope diff from stdin.


Second file or directory to compare. If omitted, no comparison is done but instead we read a diffoscope diff from path1 and will output this in the formats specified by the rest of the command line.

optional arguments


Display debug messages


Open the Python debugger in case of crashes

--status-fd FD

Send machine-readable status to file descriptor FD

--progress, --no-progress

Show an approximate progress bar. Default: yes if stdin is a tty, otherwise no.


Disable most default output limits and diff calculation limits.

output types


Write plain text output to given file (use - for stdout)

--text-color WHEN

When to output color diff. WHEN is one of {never, auto, always}. Default: auto, meaning yes if the output is a terminal, otherwise no.


If there was no difference, then output an empty diff for each output type that was specified. In --text output, an empty file is written.


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 --html and --html-dir output. If this is a non-existent relative URL, diffoscope will create a symlink to a system installation. (Paths searched: /usr/share/javascript/jquery/jquery.js.) If not given, --html output will not use JS but --htmldir will if it can be found; give "disable" to disable JS on all outputs.


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)

--profile OUTPUT_FILE

Write profiling info to given file (use - for stdout)

output limits

--max-text-report-size BYTES

Maximum bytes written in --text report. (0 to 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. (0 to disable, default: 41943040)

--max-diff-block-lines LINES

Maximum number of lines output per unified-diff block, across all pages. (0 to disable, default: 1024)

--max-page-size BYTES

Maximum bytes of the top-level (--html-dir) or sole (--html) page. (default: 409600, remains in effect even with --no-default-limits)

--max-page-size-child BYTES

In --html-dir output, this is the maximum bytes of each child page (default: 204800, 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 child pages (--html-dir) or skipping the rest of the diff block. Child pages are limited instead by --max-page-size-child. (default: 128, remains in effect even with --no-default-limits)

diff calculation


Treat absent files as empty

--exclude GLOB_PATTERN

Exclude files that match GLOB_PATTERN

--exclude-command REGEX_PATTERN

Exclude commands that match REGEX_PATTERN. For example, '^readelf.*\s--debug-dump=info' takes by far the longest time, and differences here are probably only secondary differences caused by something that is already represented elsewhere in the diff.

--exclude-directory-metadata, --no-exclude-directory-metadata

Exclude directory metadata. Useful if comparing files whose filesystem-level metadata is not intended to be distributed to other systems. For example, this is true for most distros' package builders, but not true for the output of commands like `make install`. Metadata of archive members remain un-excluded. Default: False

--fuzzy-threshold FUZZY_THRESHOLD

Threshold for fuzzy-matching (0 to disable, 60 is default, 400 is 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 to diff(1) (0 to disable, default: 4194304)

--max-container-depth DEPTH

Maximum depth to recurse into containers. (Cannot be disabled for security reasons, default: 50)

--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 truncates diff(1) output before emitting it in a report, and affects all types of output, including --text and --json. (0 to disable, default: 0)


Force recursing into the depths of file formats even if files have the same content, only really useful for debugging diffoscope. Default: False

information commands

--help, -h

Show this help and exit


Show program's version number and exit

--list-tools [DISTRO]

Show external tools required and exit. DISTRO can be one of {arch, debian, FreeBSD}. If specified, the output will list packages in that distribution that satisfy these dependencies.


List packages needed for Debian in 'substvar' format.

File renaming detection based on fuzzy-matching is currently disabled. It can be enabled by installing the "tlsh" module available at https://github.com/trendmicro/tlsh

Referenced By

debdiff(1), debrepro(1).

February 2018 diffoscope 90 User Commands