Compare two text files with context.
Section: diff, cmp, and patch-Oriented Comparison
Show unified diff
bash
bash
diff -u old.conf new.confExplanation
Unified diff format is the most common comparison output for reviews and patches.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing diff, cmp, and patch-Oriented Comparison