LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

diffstat

patch file statistics generator

TLDR

Show diff statistics
$ diffstat [patch.diff]
copy
Show from piped diff
$ diff -u [old] [new] | diffstat
copy
Show with specific filename format
$ diffstat -f [0|1|2|3|4] [patch.diff]
copy
Strip path components like patch -p
$ diffstat -p [1] [patch.diff]
copy
Show as a table
$ diffstat -t [patch.diff]
copy
Set histogram output width
$ diffstat -w [80] [patch.diff]
copy

SYNOPSIS

diffstat [options] [file]

DESCRIPTION

diffstat reads output from diff and produces a histogram showing insertions, deletions, and modifications per file. It is commonly used to summarize patch statistics.Reads from stdin by default, or from a specified file.

PARAMETERS

-C

Strip ANSI color escape sequences before parsing. Useful with colordiff output.
-c
Show concise output with a single histogram code per file: `+` (insert), `-` (delete), `!` (modify).
-D dir
Directory of result files to compute unchanged line counts.
-f format
Filename format: 0=path, 1=name, 2=auto, 3=dir, 4=count.
-l
List filenames only.
-m
Merge insert/delete counts from each chunk to approximate modified lines.
-p num
Strip num leading path components (like `patch -p`).
-S dir
Directory containing original files (before applying diff).
-t
Output as a comma-separated table.
-u
Assume patch was created with old and new files swapped.
-w width
Set output width (histogram is never shorter than 10 columns).

SEE ALSO

diff(1), patch(1)

Copied to clipboard
Kai