OS Manuals

/usr/bin/diffstat

Utility that makes a histogram of diff output

From diffstat 1.69-r3 (enterprise-packages), captured 2026-11-08 by running diffstat --help (exit 0). permalink

Usage: diffstat [options] [files]

Reads from one or more input files which contain output from 'diff',
producing a histogram of total lines changed for each file referenced.
If no filename is given on the command line, reads from standard input.

Options:
  -b      ignore lines matching "Binary files XXX and YYY differ"
  -c      prefix each line with comment (#)
  -C      add SGR color escape sequences to highlight the histogram
  -d      debug - prints a lot of information
  -D PATH specify location of patched files, use for unchanged-count
  -e FILE redirect standard error to FILE
  -E      trim escape-sequences, e.g., from colordiff
  -f NUM  format (0=concise, 1=normal, 2=filled, 4=values)
  -h      print this message
  -k      do not merge filenames
  -K      resolve ambiguity of "only" filenames
  -l      list filenames only
  -m      merge insert/delete data in chunks as modified-lines
  -n NUM  specify minimum width for the filenames (default: auto)
  -N NUM  specify maximum width for the filenames (default: auto)
  -o FILE redirect standard output to FILE
  -O      inspect only files listed in diff for -S/-D options
  -p NUM  specify number of pathname-separators to strip (default: common)
  -q      suppress the "0 files changed" message for empty diffs
  -r NUM  specify rounding for histogram (0=none, 1=simple, 2=adjusted)
  -R      assume patch was created with old and new files swapped
  -s      show only the summary line
  -S PATH specify location of original files, use for unchanged-count
  -t      print a table (comma-separated-values) rather than histogram
  -T      print amounts (like -t option) in addition to histogram
  -u      do not sort the input list
  -v      show progress if output is redirected to a file
  -V      prints the version number
  -w NUM  specify maximum width of the output (default: 80)
Options (29)
OptionDescriptionSource
-bignore lines matching "Binary files XXX and YYY differ" in the diffhelp + man
-cprefix each line of output with "#", making it a comment-line for shell scripts.help + man
-Cadd SGR color escape sequences to highlight the histogram.help + man
-dThe debug prints a lot of information.help + man
-Estrip out ANSI escape sequences on each line before parsing the differences.help + man
-f NUMformat (0=concise, 1=normal, 2=filled, 4=values)help + man
-hprints the usage message and exits.help + man
-ksuppress the merging of filenames in the report.help + man
-Kattempt to improve the annotation of "only" files by looking for a match in the resulting set of files and inferring whether the file was added or removed.help + man
-llists only the filenames.help + man
-mmerge insert/delete counts from each "chunk" of the patch file to approximate a count of the modified lines.help + man
-n NUMspecify minimum width for the filenames (default: auto)help + man
-N NUMspecify maximum width for the filenames (default: auto)help + man
-Oinspect only files listed in diff for -S/-D optionshelp
-p NUMoverride the logic that strips common pathnames, simulating the patch "-p" option.help + man
-qsuppress the "0 files changed" message for empty diffs.help + man
-r NUMprovides optional rounding of the data shown in histogram, rather than truncating with error adjustments.help + man
-RAssume patch was created with old and new files swapped.help + man
-sshow only the summary line, e.g., number of insertions and deletions.help + man
-toverrides the histogram, generates output of comma separated values for the number of changed lines found in the differences for each file: inserted, deleted and modified.help + man
-Tprints the numbers that the -t option would show, between the pathname and histogram.help + man
-usuppress the sorting of filenames in the report.help + man
-vshow progress, e.g., if the output is redirected to a file, write progress messages to the standard error.help + man
-Vprints the current version number and exits.help + man
-w NUMspecify maximum width of the output (default: 80)help + man
-D destinationspecify a directory containing files which can be referred to as the result of applying the differences. (in the manual page but not in --help)man
-e fileredirect standard error to file. (in the manual page but not in --help)man
-o fileredirect standard output to file. (in the manual page but not in --help)man
-S sourcethis is like the -D option, but specifies a location where the original files (before applying differences) can be found. (in the manual page but not in --help)man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.