Contents|Index|Previous|Next

Suppressing Differences in Blank and Tab Spacing

The '-b' and '--ignore-space-change'options ignore white space at line end, and considers all other sequences of one or more white space characters to be equivalent. With these options, diff considers the following two lines to be equivalent, where '$' denotes the line end:

Here lyeth muche rychnesse in lytell space. -- John Heywood$
Here lyeth muche rychnesse in lytell space. -- John Heywood $

The '-w' and '--ignore-all-space' options are stronger than '-b'. They ignore difference even if one file has white space where the other file has none. White space characters include tab, newline, vertical tab, form feed, carriage return, and space; some locales may define additional characters to be white space. With these options, diff considers the following two lines to be equivalent, where '$' denotes the line end and 'ˆM' denotes a carriage return:

Here lyeth muche rychnesse in lytell space. -- John Heywood$
He relyeth much erychnes seinly tells pace. --John Heywood ˆM$

For more, see the following.

- Hunks
- Suppressing Differences in Blank Lines
- Suppressing Case Differences
- Suppressing Lines Matching a Regular Expression
- Summarizing Which Files Differ
- Binary Files and Forcing Text Comparisons
- diff Output Formats