|
5 | 5 | * [cmp](#cmp)
|
6 | 6 | * [diff](#diff)
|
7 | 7 | * [Comparing Directories](#comparing-directories)
|
| 8 | + * [colordiff](#colordiff) |
8 | 9 |
|
9 | 10 | <br>
|
10 | 11 |
|
@@ -149,28 +150,22 @@ $ echo $?
|
149 | 150 | * ignoring difference in white spaces
|
150 | 151 |
|
151 | 152 | ```bash
|
152 |
| -$ diff <(echo 'good day') <(echo 'good day') |
153 |
| -1c1 |
154 |
| -< good day |
155 |
| ---- |
156 |
| -> good day |
157 | 153 | $ # -b option to ignore changes in the amount of white space
|
158 | 154 | $ diff -b <(echo 'good day') <(echo 'good day')
|
159 | 155 | $ echo $?
|
160 | 156 | 0
|
161 | 157 |
|
162 |
| -$ diff <(echo 'hi there ') <(echo ' hi there') |
163 |
| -1c1 |
164 |
| -< hi there |
165 |
| ---- |
166 |
| -> hi there |
167 | 158 | $ # -w option to ignore all white spaces
|
168 | 159 | $ diff -w <(echo 'hi there ') <(echo ' hi there')
|
169 | 160 | $ echo $?
|
170 | 161 | 0
|
171 | 162 | $ diff -w <(echo 'hi there ') <(echo 'hithere')
|
172 | 163 | $ echo $?
|
173 | 164 | 0
|
| 165 | +
|
| 166 | +# use -B to ignore only blank lines |
| 167 | +# use -E to ignore changes due to tab expansion |
| 168 | +# use -z to ignore trailing white spaces at end of line |
174 | 169 | ```
|
175 | 170 |
|
176 | 171 | * side-by-side output
|
@@ -299,21 +294,39 @@ diff -r dir1/i1 dir2/i1
|
299 | 294 | diff -r dir1/subdir/f1 dir2/subdir/f1
|
300 | 295 | ```
|
301 | 296 |
|
302 |
| -* See [GNU diffutils manual - comparing directories](https://www.gnu.org/software/diffutils/manual/diffutils.html#Comparing-Directories) for further options and details like excluding files, ignoring filename case, etc |
| 297 | +* See also [GNU diffutils manual - comparing directories](https://www.gnu.org/software/diffutils/manual/diffutils.html#Comparing-Directories) for further options and details like excluding files, ignoring filename case, etc and `dirdiff` command |
303 | 298 |
|
304 | 299 | <br>
|
305 | 300 |
|
306 |
| -*More to come* |
| 301 | +#### <a name="colordiff"></a>colordiff |
| 302 | +
|
| 303 | +```bash |
| 304 | +$ whatis colordiff |
| 305 | +colordiff (1) - a tool to colorize diff output |
| 306 | +
|
| 307 | +$ whatis wdiff |
| 308 | +wdiff (1) - display word differences between text files |
| 309 | +``` |
| 310 | +
|
| 311 | +* simply replace `diff` with `colordiff` |
| 312 | +
|
| 313 | + |
| 314 | +
|
| 315 | +* or, pass output of a `diff` tool to `colordiff` |
| 316 | +
|
| 317 | + |
| 318 | +
|
| 319 | +* See also [stackoverflow - How to colorize diff on the command line?](https://stackoverflow.com/questions/8800578/how-to-colorize-diff-on-the-command-line) for other options |
307 | 320 |
|
308 | 321 | <br>
|
309 | 322 |
|
310 | 323 | **Further Reading**
|
311 | 324 |
|
312 | 325 | * `man diff` and `info diff` for more options and detailed documentation
|
313 |
| -* [GNU diffutils manual](https://www.gnu.org/software/diffutils/manual/diffutils.html) for a better documentation than `man/info` versions |
314 |
| -* `diff3`, `vimdiff/gvimdiff` and `patch` commands |
| 326 | + * [GNU diffutils manual](https://www.gnu.org/software/diffutils/manual/diffutils.html) for a better documentation |
| 327 | +* `man -k diff` to get list of all commands related to `diff` |
315 | 328 | * [diff Q&A on unix stackexchange](https://unix.stackexchange.com/questions/tagged/diff?sort=votes&pageSize=15)
|
316 |
| -* [GUI diff and merge tools](http://askubuntu.com/questions/2946/what-are-some-good-gui-diff-and-merge-applications-available-for-ubuntu) |
| 329 | +* [unix.stackexchange - GUI diff and merge tools](https://unix.stackexchange.com/questions/4573/which-gui-diff-viewer-would-you-recommend-with-copy-to-left-right-functionality) |
317 | 330 | * [unix.stackexchange - Understanding diff output](https://unix.stackexchange.com/questions/81998/understanding-of-diff-output)
|
318 | 331 | * [stackoverflow - Using output of diff to create patch](https://stackoverflow.com/questions/437219/using-the-output-of-diff-to-create-the-patch)
|
319 | 332 |
|
0 commit comments