OS Manuals

/usr/bin/grepdiff

Manipulate patch files

From patchutils 0.4.5-r3 (enterprise-packages), captured 2026-11-08 by running grepdiff --help (exit 0). permalink

usage: grepdiff [OPTION]... REGEX [files ...]
Options:
  -x PAT, --exclude=PAT
            exclude files matching PAT
  -X FILE, --exclude-from-file=FILE
            exclude files that match any pattern in FILE
  -i PAT, --include=PAT
            include only files matching PAT
  -I FILE, --include-from-file=FILE
            include only files that match any pattern in FILE
  -# H, --hunks=H
            include only hunks in range H, if range begins with x show all excluding range H
  --lines=L include only hunks with (original) lines in range L, if range begins with x show all excluding range L
  -F F, --files=F
            include only files in range F, if range begins with x show all excluding range F
  --annotate
            annotate each hunk with the filename and hunk number
  --as-numbered-lines=before|after|original-before|original-after
            display lines as they would look before, or after, the patch is applied;
            or with original line numbers from the diff (original-before or original-after)
  --format=context|unified
            set output format
  --output-matching=hunk|file
            show matching hunks or file-level diffs
  --only-match=rem|removals|add|additions|mod|modifications|all
            regex will only match removals, additions, modifications or
            the whole hunk
  --remove-timestamps
            don't show timestamps from output
  -z, --decompress
            decompress .gz and .bz2 files
  -n, --line-number
            show line numbers
  -N, --number-files
            show file numbers, for use with filterdiff's --files option
  -H, --with-filename
            show patch file names
  -h, --no-filename
            suppress patch file names
  -p N, --strip-match=N
            initial pathname components to ignore
  --strip=N initial pathname components to strip
  --git-prefixes=strip|keep
            how to handle a/ and b/ prefixes in Git diffs for both filename
            matching (-i/-x) and output (default: keep)
  --git-extended-diffs=exclude|include
            process Git diffs without hunks: renames, copies, mode-only
            changes, binary files; default is exclude
  --addprefix=PREFIX
            prefix pathnames with PREFIX
  --addoldprefix=PREFIX
            prefix pathnames in old files with PREFIX
  --addnewprefix=PREFIX
            prefix pathnames in new files with PREFIX
  -s, --status
            show file additions (+), removals (-), and modifications (!)
  -v, --verbose
            verbose output -- use more than once for extra verbosity
  -E, --extended-regexp
            use extended regexps, like egrep
  --empty-files-as-absent
            treat empty files as absent
  -f FILE, --file=FILE
            read regular expressions from FILE
  --filter  run as 'filterdiff'
  --list    run as 'lsdiff'
Options (30)
OptionDescriptionSource
-x, --exclude PATexclude files matching PAThelp
-X, --exclude-from-file FILEexclude files that match any pattern in FILEhelp
-i, --include PATinclude only files matching PAThelp
-I, --include-from-file FILEinclude only files that match any pattern in FILEhelp
-#, --hunks Hinclude only hunks in range H, if range begins with x show all excluding range Hhelp
-F, --files Finclude only files in range F, if range begins with x show all excluding range Fhelp
--annotateannotate each hunk with the filename and hunk numberhelp
--as-numbered-linesdisplay lines as they would look before, or after, the patch is applied;help
--format context|unifiedset output formathelp
--output-matching hunk|fileshow matching hunks or file-level diffshelp
--only-matchregex will only match removals, additions, modifications or the whole hunkhelp
--remove-timestampsdon't show timestamps from outputhelp
-z, --decompressdecompress .gz and .bz2 fileshelp
-n, --line-numbershow line numbershelp
-N, --number-filesshow file numbers, for use with filterdiff's --files optionhelp
-H, --with-filenameshow patch file nameshelp
-h, --no-filenamesuppress patch file nameshelp
-p, --strip-match Ninitial pathname components to ignorehelp
--git-prefixes strip|keephow to handle a/ and b/ prefixes in Git diffs for both filename matching (-i/-x) and output (default: keep)help
--git-extended-diffs exclude|includeprocess Git diffs without hunks: renames, copies, mode-only changes, binary files;help
--addprefix PREFIXprefix pathnames with PREFIXhelp
--addoldprefix PREFIXprefix pathnames in old files with PREFIXhelp
--addnewprefix PREFIXprefix pathnames in new files with PREFIXhelp
-s, --statusshow file additions (+), removals (-), and modifications (!)help
-v, --verboseverbose output -- use more than once for extra verbosityhelp
-E, --extended-regexpuse extended regexps, like egrephelp
--empty-files-as-absenttreat empty files as absenthelp
-f, --file FILEread regular expressions from FILEhelp
--filterrun as 'filterdiff'help
--listrun as 'lsdiff'help

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