Detect exact byte-level differences.
Section: diff, cmp, and patch-Oriented Comparison
Compare files byte by byte
bash
bash
cmp file1.bin file2.binExplanation
`cmp` is simpler than diff when you only need to know whether files differ and where the first difference occurs.
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