Home Explore Blog CI



man-pages

2nd chunk of `diff.man`
a2ec40e84b162afb9502bd31a6a0d05a772f6982a2a2afd100000001000008fc
 FILE

       -S, --starting-file=FILE
              start with FILE when comparing directories

       --from-file=FILE1
              compare FILE1 to all operands; FILE1 can be a directory

       --to-file=FILE2
              compare all operands to FILE2; FILE2 can be a directory

       -i, --ignore-case
              ignore case differences in file contents

       -E, --ignore-tab-expansion
              ignore changes due to tab expansion

       -Z, --ignore-trailing-space
              ignore white space at line end

       -b, --ignore-space-change
              ignore changes in the amount of white space

       -w, --ignore-all-space
              ignore all white space

       -B, --ignore-blank-lines
              ignore changes where lines are all blank

       -I, --ignore-matching-lines=RE
              ignore changes where all lines match RE

       -a, --text
              treat all files as text

       --strip-trailing-cr
              strip trailing carriage return on input

       -D, --ifdef=NAME
              output merged file with ’#ifdef NAME’ diffs

       --GTYPE-group-format=GFMT
              format GTYPE input groups with GFMT

       --line-format=LFMT
              format all input lines with LFMT

       --LTYPE-line-format=LFMT
              format LTYPE input lines with LFMT

              These format options provide fine-grained control over the output

              of diff, generalizing -D/--ifdef.

       LTYPE is ’old’, ’new’, or ’unchanged’.
              GTYPE is LTYPE or ’changed’.

              GFMT (only) may contain:

       %<     lines from FILE1

       %>     lines from FILE2

       %=     lines common to FILE1 and FILE2

       %[-][WIDTH][.[PREC]]{doxX}LETTER
              printf-style spec for LETTER

              LETTERs are as follows for new group, lower case for old group:

       F      first line number

       L      last line number

       N      number of lines = L-F+1

       E      F-1

       M      L+1

       %(A=B?T:E)
              if A equals B then T else E

              LFMT (only) may contain:

       %L     contents of line

       %l     contents of line, excluding any trailing newline

       %[-][WIDTH][.[PREC]]{doxX}n
              printf-style spec for

Title: DIFF(1) - Options for File Comparison and Output Formatting (Continued)
Summary
This section details further options for the `diff` command, focusing on file comparison behaviors and output formatting controls. It includes options for ignoring case, whitespace, and blank lines during comparison, as well as treating all files as text. The section also covers advanced formatting options using `--GTYPE-group-format` and `--line-format` to customize the output with fine-grained control, including conditional formatting based on line types (old, new, unchanged) and content.