diff Command Colorize Output On the Unix / Linux Command Line

Originally published at: https://www.cyberciti.biz/programming/color-terminal-highlighter-for-diff-files/

The diff command compare files line by line and displays a list of changes between two file. You can use diff command to:

  1. See the changes between one version of a file.
  2. Compare two configuration or program files.
  3. Create a patch file which can be applied with the Linux / Unix program patch.

Say hello to colordiff

colordiff is a wrapper for diff and produces the same output as diff but with coloured syntax highlighting at the command line to improve readability. colordiff has been tested on various flavours of Linux and under OpenBSD, but should be broadly portable to other systems.