Diff -b and -w difference
- by dotancohen
From the diff manpage:
-b, --ignore-space-change
ignore changes in the amount of white space
-w, --ignore-all-space
ignore all white space
From this, I infer that the difference between the -b and -w options must be that -b is sensitive to the type of whitespace (tabs vs. spaces). However, that does not seem to be the case:
$ diff 1.txt 2.txt
1,3c1,3
< Four spaces, changed to one tab
< Eight Spaces, changed to two tabs
< Four spaces, changed to two spaces
---
> Four spaces, changed to one tab
> Eight Spaces, changed to two tabs
> Four spaces, changed to two spaces
$ diff -b 1.txt 2.txt
$ diff -w 1.txt 2.txt
$
So, what is the difference between the -b and -w options? Tested with diffutils 3.2 on Kubuntu Linux 13.04.