DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(diff.info.gz) diff Options

Info Catalog (diff.info.gz) Invoking diff
 
 Options to `diff'
 =================
 
    Below is a summary of all of the options that GNU `diff' accepts.
 Most options have two equivalent names, one of which is a single letter
 preceded by `-', and the other of which is a long name preceded by
 `--'.  Multiple single letter options (unless they take an argument)
 can be combined into a single command line word: `-ac' is equivalent to
 `-a -c'.  Long named options can be abbreviated to any unique prefix of
 their name.  Brackets ([ and ]) indicate that an option takes an
 optional argument.
 
 `-a'
 `--text'
      Treat all files as text and compare them line-by-line, even if they
      do not seem to be text.   Binary.
 
 `-b'
 `--ignore-space-change'
      Ignore changes in amount of white space.   White Space.
 
 `-B'
 `--ignore-blank-lines'
      Ignore changes that just insert or delete blank lines.  
      Blank Lines.
 
 `--binary'
      Read and write data in binary mode.   Binary.
 
 `-c'
      Use the context output format, showing three lines of context.
       Context Format.
 
 `-C LINES'
 `--context[=LINES]'
      Use the context output format, showing LINES (an integer) lines of
      context, or three if LINES is not given.   Context Format.
      For proper operation, `patch' typically needs at least two lines of
      context.
 
      On older systems, `diff' supports an obsolete option `-LINES' that
      has effect when combined with `-c' or `-p'.  POSIX 1003.1-2001
      ( Standards conformance) does not allow this; use `-C LINES'
      instead.
 
 `--changed-group-format=FORMAT'
      Use FORMAT to output a line group containing differing lines from
      both files in if-then-else format.   Line Group Formats.
 
 `-d'
 `--minimal'
      Change the algorithm perhaps find a smaller set of changes.  This
      makes `diff' slower (sometimes much slower).   diff
      Performance.
 
 `-D NAME'
 `--ifdef=NAME'
      Make merged `#ifdef' format output, conditional on the preprocessor
      macro NAME.   If-then-else.
 
 `-e'
 `--ed'
      Make output that is a valid `ed' script.   ed Scripts.
 
 `-E'
 `--ignore-tab-expansion'
      Ignore changes due to tab expansion.   White Space.
 
 `-f'
 `--forward-ed'
      Make output that looks vaguely like an `ed' script but has changes
      in the order they appear in the file.   Forward ed.
 
 `-F REGEXP'
 `--show-function-line=REGEXP'
      In context and unified format, for each hunk of differences, show
      some of the last preceding line that matches REGEXP.  
      Specified Headings.
 
 `--from-file=FILE'
      Compare FILE to each operand; FILE may be a directory.
 
 `--help'
      Output a summary of usage and then exit.
 
 `--horizon-lines=LINES'
      Do not discard the last LINES lines of the common prefix and the
      first LINES lines of the common suffix.   diff Performance.
 
 `-i'
 `--ignore-case'
      Ignore changes in case; consider upper- and lower-case letters
      equivalent.   Case Folding.
 
 `-I REGEXP'
 `--ignore-matching-lines=REGEXP'
      Ignore changes that just insert or delete lines that match REGEXP.
       Specified Folding.
 
 `--ignore-file-name-case'
      Ignore case when comparing file names during recursive comparison.
       Comparing Directories.
 
 `-l'
 `--paginate'
      Pass the output through `pr' to paginate it.   Pagination.
 
 `--label=LABEL'
      Context Format::) and unified format ( Unified Format)
      headers.   RCS.
 
 `--left-column'
      Print only the left column of two common lines in side by side
      format.   Side by Side Format.
 
 `--line-format=FORMAT'
      Use FORMAT to output all input lines in if-then-else format.
       Line Formats.
 
 `-n'
 `--rcs'
      Output RCS-format diffs; like `-f' except that each command
      specifies the number of lines affected.   RCS.
 
 `-N'
 `--new-file'
      In directory comparison, if a file is found in only one directory,
      treat it as present but empty in the other directory.  
      Comparing Directories.
 
 `--new-group-format=FORMAT'
      Use FORMAT to output a group of lines taken from just the second
      file in if-then-else format.   Line Group Formats.
 
 `--new-line-format=FORMAT'
      Use FORMAT to output a line taken from just the second file in
      if-then-else format.   Line Formats.
 
 `--old-group-format=FORMAT'
      Use FORMAT to output a group of lines taken from just the first
      file in if-then-else format.   Line Group Formats.
 
 `--old-line-format=FORMAT'
      Use FORMAT to output a line taken from just the first file in
      if-then-else format.   Line Formats.
 
 `-p'
 `--show-c-function'
      Show which C function each change is in.   C Function
      Headings.
 
 `-q'
 `--brief'
      Report only whether the files differ, not the details of the
      differences.   Brief.
 
 `-r'
 `--recursive'
      When comparing directories, recursively compare any subdirectories
      found.   Comparing Directories.
 
 `-s'
 `--report-identical-files'
      Report when two files are the same.   Comparing Directories.
 
 `-S FILE'
 `--starting-file=FILE'
      When comparing directories, start with the file FILE.  This is
      used for resuming an aborted comparison.   Comparing
      Directories.
 
 `--speed-large-files'
      Use heuristics to speed handling of large files that have numerous
      scattered small changes.   diff Performance.
 
 `--strip-trailing-cr'
      Strip any trailing carriage return at the end of an input line.
       Binary.
 
 `--suppress-common-lines'
      Do not print common lines in side by side format.   Side by
      Side Format.
 
 `-t'
 `--expand-tabs'
      Expand tabs to spaces in the output, to preserve the alignment of
      tabs in the input files.   Tabs.
 
 `-T'
 `--initial-tab'
      Output a tab rather than a space before the text of a line in
      normal or context format.  This causes the alignment of tabs in
      the line to look normal.   Tabs.
 
 `--to-file=FILE'
      Compare each operand to FILE; FILE may be a directory.
 
 `-u'
      Use the unified output format, showing three lines of context.
       Unified Format.
 
 `--unchanged-group-format=FORMAT'
      Use FORMAT to output a group of common lines taken from both files
      in if-then-else format.   Line Group Formats.
 
 `--unchanged-line-format=FORMAT'
      Use FORMAT to output a line common to both files in if-then-else
      format.   Line Formats.
 
 `--unidirectional-new-file'
      When comparing directories, if a file appears only in the second
      directory of the two, treat it as present but empty in the other.
       Comparing Directories.
 
 `-U LINES'
 `--unified[=LINES]'
      Use the unified output format, showing LINES (an integer) lines of
      context, or three if LINES is not given.   Unified Format.
      For proper operation, `patch' typically needs at least two lines of
      context.
 
      On older systems, `diff' supports an obsolete option `-LINES' that
      Standards conformance::) does not allow this; use `-U LINES'
      instead.
 
 `-v'
 `--version'
      Output version information and then exit.
 
 `-w'
 `--ignore-all-space'
      Ignore white space when comparing lines.   White Space.
 
 `-W COLUMNS'
 `--width=COLUMNS'
      Output at most COLUMNS (default 130) print columns per line in
      side by side format.   Side by Side Format.
 
 `-x PATTERN'
 `--exclude=PATTERN'
      When comparing directories, ignore files and subdirectories whose
      basenames match PATTERN.   Comparing Directories.
 
 `-X FILE'
 `--exclude-from=FILE'
      When comparing directories, ignore files and subdirectories whose
      basenames match any pattern contained in FILE.   Comparing
      Directories.
 
 `-y'
 `--side-by-side'
      Use the side by side output format.   Side by Side Format.
 
Info Catalog (diff.info.gz) Invoking diff
automatically generated byinfo2html