The result of git by git diff --word-diff
is great. But how to do diff like git diff --word-diff
without git on Linux? The plain diff
command on Linux seems not accept options like --word-diff
.
The wdiff
is for word-diff:
wdiff program
is a front end to diff for comparing files on a word per word basis. A word is anything between whitespace.
$ wdiff file1 file2
Bonus: colordiff is a wrapper for ‘diff’. colordiff is written in Perl and produces the same output but with pretty ‘syntax’ highlighting.
$ wdiff file1 file2 | colordiff
or
$ wdiff file1 file2 | colordiff | less -R
Answered by Eric Z Ma.