Section: diff, cmp, and patch-Oriented Comparison

Show side-by-side diff

bash
bash
sdiff file1.txt file2.txt
Explanation

Side-by-side comparison is useful for quick visual inspection.

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
Show unified diff
Compare two text files with context.
OpenIn sheetbashsame section
Compare directories recursively
Find differences across two directory trees.
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.