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/
Смотрите видео How to use the colordiff command онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь InfoWorld 24 Сентябрь 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 121 раз и оно понравилось 8 людям.