How to use the diff3 command

Опубликовано: 26 Сентябрь 2024
на канале: InfoWorld
9
11

In this Linux tip, we’re going to look at the diff3 command. It’s similar to the diff command, but allows you to compare the contents of three text files instead of just two. In addition, the formatting of the output makes it easy to understand how the files are different.
In this command, we compare three simple text files:
$ diff3 file1 file2 file3
====3
1:1,3c
2:1,3c
Kids, the seven basic food
groups are gum, puff pastry,
pizza, pesticides, antibiotics,
3:1,3c
Kids, the six basic food
groups are fruits, vegetables,
grains, protein and dairy
The ====3 included in the output below means that the third file is different. If all the files were different, this would show just ====. The output then shows the differences between the first two files (which are the same) and the third which has a different third line.
Looking at file3, we can see a 4th line. This line didn’t show up in the diff3 output because it’s the same in all three files. The diff3 command only displays differences.





-----------------------------­---
SUBSCRIBE: http://www.youtube.com/subscription_c...
FACEBOOK:   / infoworld  
TWITTER:   / infoworld  
WEBSITE: http://www.infoworld.com/


Смотрите видео How to use the diff3 command онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь InfoWorld 26 Сентябрь 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели раз и оно понравилось 1 людям.