{
    "mode": "info",
    "parameter": "wdiff",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/wdiff/json",
    "generated": "2026-11-15T13:35:48Z",
    "sections": {
        "File: wdiff.info,  Node: wdiff invocation,  Next: wdiff Examples,  Up: wdiff": {
            "content": "",
            "subsections": [
                {
                    "name": "2.1 Invoking 'wdiff'",
                    "content": "The format for running the 'wdiff' program is:\n\nwdiff OPTION ... OLDFILE NEWFILE\nwdiff OPTION ... -d [DIFFFILE]\n\n'wdiff' compares files OLDFILE and NEWFILE and produces an\nannotated copy of NEWFILE on standard output.  The empty string or the\nstring '-' denotes standard input, but standard input cannot be used\ntwice in the same invocation.  The complete path of a file should be\ngiven, a directory name is not accepted.  'wdiff' will exit with a\nstatus of 0 if no differences were found, a status of 1 if any\ndifferences were found, or a status of 2 for any error.\n\nIn this documentation, \"deleted text\" refers to text in OLDFILE\nwhich is not in NEWFILE, while \"inserted text\" refers to text on\nNEWFILE which is not in OLDFILE.\n\n'wdiff' supports the following command line options:\n\n'--help'\n'-h'\nPrint an informative help message describing the options.\n\n'--version'\n'-v'\nPrint the version number of 'wdiff' on the standard error output.\n\n'--no-deleted'\n'-1'\nAvoid producing deleted words on the output.  If neither '-1' or\n'-2' is selected, the original right margin may be exceeded for\nsome lines.\n\n'--no-inserted'\n'-2'\nAvoid producing inserted words on the output.  When this flag is\ngiven, the whitespace in the output is taken from OLDFILE instead\nof NEWFILE.  If neither '-1' or '-2' is selected, the original\nright margin may be exceeded for some lines.\n\n'--no-common'\n'-3'\nAvoid producing common words on the output.  When this option is\nnot selected, common words and whitespace are taken from NEWFILE,\nunless option '-2' is given, in which case common words and\nwhitespace are rather taken from OLDFILE.  When selected,\ndifferences are separated from one another by lines of dashes.\nMoreover, if this option is selected at the same time as '-1' or\n'-2', then none of the output will have any emphasis, i.e.  no bold\nor underlining.  Finally, if this option is not selected, but both\n'-1' and '-2' are, then sections of common words between\ndifferences are segregated by lines of dashes.\n\n'--ignore-case'\n'-i'\nDo not consider case difference while comparing words.  Each lower\ncase letter is seen as identical to its upper case equivalent for\nthe purpose of deciding if two words are the same.\n\n'--statistics'\n'-s'\nOn completion, for each file, the total number of words, the number\nof common words between the files, the number of words deleted or\ninserted and the number of words that have changed is output.  (A\nchanged word is one that has been replaced or is part of a\nreplacement.)  Except for the total number of words, all of the\nnumbers are followed by a percentage relative to the total number\nof words in the file.\n\n'--auto-pager'\n'-a'\nSome initiatives which were previously automatically taken in\nprevious versions of 'wdiff' are now put under the control of this\noption.  By using it, a pager is interposed whenever the 'wdiff'\noutput is directed to the user's terminal.  Without this option, no\npager will be called, the user is then responsible for explicitly\npiping 'wdiff' output into a pager, if required.\n\nThe pager is selected by the value of the PAGER environment\nvariable when 'wdiff' is run.  If PAGER is not defined at run time,\nthen a default pager, selected at installation time, will be used\ninstead.  A defined but empty value of PAGER means no pager at all.\n\nWhen a pager is interposed through the use of this option, one of\nthe options '-l' or '-t' is also selected, depending on whether the\nstring 'less' appears in the pager's name or not.\n\nIt is often useful to define 'wdiff' as an alias for 'wdiff -a'.\nHowever, this hides the normal 'wdiff' behaviour.  The default\nbehaviour may be restored simply by piping the output from 'wdiff'\nthrough 'cat'.  This dissociates the output from the user's\nterminal.\n\n'--printer'\n'-p'\nUse over-striking to emphasize parts of the output.  Each character\nof the deleted text is underlined by writing an underscore ''\nfirst, then a backspace and then the letter to be underlined.  Each\ncharacter of the inserted text is emboldened by writing it twice,\nwith a backspace in between.  This option is not selected by\ndefault.\n\n'--less-mode'\n'-l'\nUse over-striking to emphasize parts of output.  This option works\nas option '-p', but also over-strikes whitespace associated with\ninserted text.  'less' shows such whitespace using reverse video.\nThis option is not selected by default.  However, it is\nautomatically turned on whenever 'wdiff' launches the pager 'less'.\nSee option '-a'.\n\nThis option is commonly used in conjunction with 'less':\n\nwdiff -l OLDFILE NEWFILE | less\n\n'--terminal'\n'-t'\nForce the production of 'termcap' strings for emphasising parts of\noutput, even if the standard output is not associated with a\nterminal.  The 'TERM' environment variable must contain the name of\na valid 'termcap' entry.  If the terminal description permits,\nunderlining is used for marking deleted text, while bold or reverse\nvideo is used for marking inserted text.  This option is not\nselected by default.  However, it is automatically turned on\nwhenever 'wdiff' launches a pager, and it is known that the pager\nis not 'less'.  See option '-a'.\n\nThis option is commonly used when 'wdiff' output is not redirected,\nbut sent directly to the user terminal, as in:\n\nwdiff -t OLDFILE NEWFILE\n\nA common kludge uses 'wdiff' together with the pager 'more', as in:\n\nwdiff -t OLDFILE NEWFILE | more\n\nHowever, some versions of 'more' use 'termcap' emphasis for their\nown purposes, so strange interactions are possible.\n\n'--start-delete ARGUMENT'\n'-w ARGUMENT'\nUse ARGUMENT as the \"start delete\" string.  This string will be\noutput prior to any sequence of deleted text, to mark where it\nstarts.  By default, no start delete string is used unless there is\nno other means of distinguishing where such text starts; in this\ncase the default start delete string is '[-'.\n\n'--end-delete ARGUMENT'\n'-x ARGUMENT'\nUse ARGUMENT as the \"end delete\" string.  This string will be\noutput after any sequence of deleted text, to mark where it ends.\nBy default, no end delete string is used unless there is no other\nmeans of distinguishing where such text ends; in this case the\ndefault end delete string is '-]'.\n\n'--start-insert ARGUMENT'\n'-y ARGUMENT'\nUse ARGUMENT as the \"start insert\" string.  This string will be\noutput prior to any sequence of inserted text, to mark where it\nstarts.  By default, no start insert string is used unless there is\nno other means of distinguishing where such text starts; in this\ncase the default start insert string is '{+'.\n\n'--end-insert ARGUMENT'\n'-z ARGUMENT'\nUse ARGUMENT as the \"end insert\" string.  This string will be\noutput after any sequence of inserted text, to mark where it ends.\nBy default, no end insert string is used unless there is no other\nmeans of distinguishing where such text ends; in this case the\ndefault end insert string is '+}'.\n\n'--avoid-wraps'\n'-n'\nAvoid spanning the end of line while showing deleted or inserted\ntext.  Any single fragment of deleted or inserted text spanning\nmany lines will be considered as being made up of many smaller\nfragments not containing a newline.  So deleted text, for example,\nwill have an end delete string at the end of each line, just before\nthe new line, and a start delete string at the beginning of the\nnext line.  A long paragraph of inserted text will have each line\nbracketed between start insert and end insert strings.  This\nbehaviour is not selected by default.\n\n'--diff-input'\n'-d'\nUse single unified diff as input.  If no input file is specified,\nstandard input is used instead.  This can be used to post-process\ndiffs generated form other applications, like version control\nsystems:\n\nsvn diff | wdiff -d\n\nNote that options '-p', '-t', and '-[wxyz]' are not mutually\nexclusive.  If you use a combination of them, you will merely accumulate\nthe effect of each.  Option '-l' is a variant of option '-p'.\n"
                }
            ]
        }
    },
    "flags": [],
    "examples": [],
    "see_also": []
}