Skip to main content
The 2024 Developer Survey results are live! See the results

This will print the offset and bytes in hex:

cmp -l file1.bin file2.bin | awk '{printf "%08X %02X %02X\n", $1-1, strtonum(0$2), strtonum(0$3)}'

Edit: $1 -1 and now the first printed offset should start at 0. ;)

Dennis Williamson
  • 109.2k
  • 19
  • 172
  • 190