I'm at the beginning of shell scripting etc. and a bit challenged to find the proper way of colorzing a command's repeating output, similar to the -d option in the watch command.I want to see the changes of lsof and some other commands. That means, I want only the changed/new lines to be in red (instead of highlighted with a white background and highlighting all the following lines). Is there an elegant way to get it done with diff or any other command?Example: A red line shows a new connection via SSH.(I know, I could GREP for ESTABLISHED here, but not every command I want to watch gives me a keyword to search for. So I have to look for new/changed line in the output.)
Color output of linux command similar to 'watch -d' to highlight differences?
diff;watch