Thiemo Mättig

Thiemo Mättig

How to compare a.k.a. »diff« binary files in Ubuntu, or Linux in general? The cmp command kind of supports this via it's -l (verbose) switch, but outputs octal numbers for some reason. Nobody uses octal numbers. Try this:
cmp -l first.bin second.bin | mawk 'function c( o ) { for ( d = i = 0; i++ < length( o ); ) d = d * 8 + substr( o, i, 1 ); return d } { printf "%08X %02X %02X\n", $1 - 1, c( $2 ), c( $3 ) }'
Source: Superuser.com.
mehr schreiben


(Links wie gewohnt formatieren.)

[ < Zurück zur Übersicht ]

Impressum & Datenschutz