Skip to main content
The 2024 Developer Survey results are live! See the results
3 of 7
Now the first printed offset should start at 0.
Nifle
  • 34.6k
  • 26
  • 109
  • 140

This will print the offset and bytes in hex:

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

Or do $1-1 to have the first printed offset start at 0.

cmp -l file1.bin file2.bin | awk '{printf "%08X %02X %02X\n", $1-1, strtonum(0$2), strtonum(0$3)}'
Dennis Williamson
  • 109.2k
  • 19
  • 172
  • 190