GNU Diffutils

Classic command-line tools for finding differences. Includes diff, diff3, sdiff, cmp.

Código AbiertoLínea de Comandos
Windows, macOS, Linux⭐⭐⭐Free (GPL v3)

Descripción

GNU Diffutils is a package of several command-line programs for finding differences between files. It includes diff, diff3, sdiff, and cmp - the foundational tools used by almost all other diff software. Essential for scripting and automation.

Características clave

  • diff: compare files line by line
  • diff3: compare three files at once
  • sdiff: merge two files interactively
  • cmp: compare two files byte by byte
  • Multiple output formats (context, unified, side-by-side)
  • Available on virtually all Unix-like systems
  • Fully scriptable and automatable
  • Part of GNU Project

Instalación

# Usually pre-installed on Linux/macOS

# Ubuntu/Debian
sudo apt install diffutils

# macOS (via Xcode Command Line Tools)
xcode-select --install

# Windows (via Git Bash or WSL)

Uso

# Compare two files (unified format)
diff -u file1.txt file2.txt

# Compare three files
diff3 file1.txt file2.txt file3.txt

# Interactive merge
sdiff -o merged.txt file1.txt file2.txt

# Binary comparison
cmp file1.bin file2.bin

Ventajas

  • +Available everywhere by default
  • +Fast and reliable
  • +Essential for scripts and automation
  • +Multiple output formats
  • +Well documented

Desventajas

  • -Command-line only, no GUI
  • -Output can be hard to read
  • -No image/binary comparison
  • -No merge GUI