GNU Diffutils
Classic command-line tools for finding differences. Includes diff, diff3, sdiff, cmp.
开源命令行
Windows, macOS, Linux⭐⭐⭐Free (GPL v3)
描述
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.
主要特性
- 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
安装
# 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)使用方法
# 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优点
- +Available everywhere by default
- +Fast and reliable
- +Essential for scripts and automation
- +Multiple output formats
- +Well documented
缺点
- -Command-line only, no GUI
- -Output can be hard to read
- -No image/binary comparison
- -No merge GUI
快速信息
- 类型
- 开源
- 平台
- Windows, macOS, Linux
- 价格
- Free (GPL v3)
- 类别
- 命令行
- 热度
- ⭐⭐⭐
替代方案
- Delta
- Meld
- diff-so-fancy
相关工具
diff-so-fancy
Good-lookin' diffs. A tool that makes your diffs human-readable instead of machine-readable.
Meld
Visual diff and merge tool for developers. Compare files, directories, and version controlled projects.
KDiff3
Free diff and merge program for comparing or merging two or three files/directories.
WinMerge
Open Source differencing and merging tool for Windows. Compare folders and files visually.