I wanted to format the Unix files conditionally, I am currently working on
diff
command and wanted to know if it is possible to format the text of the diff
command output.
Example:
>Matched values should be displayed in green.
Unmatched values should be displayed in red.
Suppose I have two files file1
and file2
and my command is diff file1 file2
.
Now I wanted that suppose output contain 5 mismatch then those mismatch should be displayed in Red color. How to achieve this using unix?
In short "Change color to red for the output of diff command for values which mismatch"
Asked by Aman
(1281 rep)
Apr 16, 2015, 10:11 AM
Last activity: Jul 25, 2025, 03:26 PM
Last activity: Jul 25, 2025, 03:26 PM