In this Linux tip, we’re going to look at the colordiff command. It displays the differences between two files like the diff command, but adds color whenever the content is different. This first command has no output because the files are the same.
$ colordiff file1 file2
Now let’s compare two files with a difference.
$ colordiff file1 file3
1,3c1,3
Kids, the seven basic food a
groups are gum, puff pastry,
pizza, pesticides, antibiotics,
---
Kids, the six basic food
groups are fruits, vegetables,
grains, protein and dairy
Notice how the colors highlight the differences between the two files. Here’s the full content of file3 showing the only line the files share (line 4).
$ cat file3
Kids, the six basic food
groups are fruits, vegetables,
grains, protein and dairy
and milk duds!!
--------------------------------
SUBSCRIBE: http://www.youtube.com/subscription_c...
FACEBOOK: / infoworld
TWITTER: / infoworld
WEBSITE: http://www.infoworld.com/
Watch video How to use the colordiff command online without registration, duration hours minute second in high quality. This video was added by user InfoWorld 24 September 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 121 once and liked it 8 people.