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.
How to use the diff3 command+C2
https://www.networkworld.com/video/35...
7 ways to compare text files on Linux
https://www.networkworld.com/article/...
--------------------------------
SUBSCRIBE: / @infoworld
FACEBOOK: / infoworld
TWITTER: / infoworld
WEBSITE: https://www.infoworld.com/
Auf dieser Seite können Sie das Online-Video How to use the diff3 command mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer InfoWorld 26 September 2024 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 226 Mal angesehen und es wurde von 14 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!