Using vimdiff on Linux: Compare Files with Visual Highlighting in Vim
A little-known tool for programmers that can greatly help find problems in code is the vimdiff command in Linux.
This tool allows you to open two source code files at the same time and makes comparisons, indicating which line and what is different between the files.
This is very useful to check differences between development code and one in production, especially in interpreted languages, JSON, XML files, etc.
To use vimdiff, the command is simple: just specify which two files are to be compared:
$ vimdiff arquivo1.php arquivo2.php
The result is a screen with two windows, and with highlighting of the different lines:
Vimdiff |
Learn much more about Linux in our online course. You can enroll here. If you already have an account, or want to create one, just log in or create your user here.
Like it? Share
That was just one piece. The course teaches the whole path — from your first command to exam day.
Vimdiff