diff | Cheatsheet¶
Display the differences between two files, or each corresponding file in two directories. Each set of differences is called a "diff" or "patch". For files that are identical, diff normally produces no output; for binary (non-text) files, diff normally reports only that they are different.
This will print the offset and bytes in hex:¶
Or do $1-1 to have the first printed offset start at 0.¶
cmp -l file1.bin file2.bin \
|gawk '{printf "%08X %02X %02X\n", $1-1, strtonum(0$2), strtonum(0$3)}'