100 Useful Command-Line Utilities
by Oliver; 201457. diff, comm
diff prints out the differences between two files. It's the best way to find discrepancies between files you think are the same. If:$ cat tmp1 a a b c
$ cat tmp2 a x b cthen diff catches that line 2 is different:
$ diff tmp1 tmp2 2c2 < a --- > xcomm, for common, is similar to diff but I rarely have occasion to use it.
Note: If you're familiar with git, you know that the diff operation plays a central role in its version control system. Git has its own flavor of diff: git diff. For example, to see the difference between commit c295z17 and commit e5d6565:
$ git diff c295z17 e5d6565