I have the following command:
diff -u filea fileb | grep '^-' | sed 's/^-//' > diff.txt
It works great; it outputs a list of differences per line to a text file, and then removes every instance of '-' against each line, however I really want to understand what -u is doing and what the following means:
Output NUM (default 2) lines of unified context
Am I right in thinking unified refers to only displaying the differences rather than the context of the differences?
Also are there any potential gotchas I should be concerned about with regard to my requirement of displaying differences between two files to another file using the above command?