Section: diff, cmp, and patch-Oriented Comparison

Show unified diff

bash
bash
diff -u old.conf new.conf
Explanation

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
Compare directories recursively
Find differences across two directory trees.
OpenIn sheetbashsame section
Show side-by-side diff
Compare files in two visual columns.
OpenIn sheetbashsame section
Compare files byte by byte
Detect exact byte-level differences.
OpenIn sheetbashsame section
Pass stdin items as arguments
Convert lines into command arguments.
Split a file by line count
Create chunks of 1000 lines each.
Show most frequent error messages
Count and rank repeated lines in a log.