fbpx vimdiff on Linux: Compare Files with Visual Highlighting | Certificação Linux

Using vimdiff on Linux: Compare Files with Visual Highlighting in Vim

📅 12/07/2021 ⏱ 1 min ✍️ Uira Ribeiro
Linuxcommands
Using vimdiff on Linux: Compare Files with Visual Highlighting in Vim
Exam Pass App — mais de 7.000 questões LPI, offline, em 5 idiomas, disponível no Android e na App Store
Available on
Google Play
Available on
App Store

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

Uira Ribeiro

Prof. Uirá Ribeiro

Chair do Board do Linux Professional Institute

After years of watching professionals waste hours on simple tasks because they didn't know the right Linux tools, I decided to teach.
Today I'm the author of most of LPI's official Learning Materials and mentor to over 14,000 certified students.

See my full story →

That was just one piece. The course teaches the whole path — from your first command to exam day.

Certificação Linux — a plataforma líder em certificações Linux no Brasil
WhatsApp