20121102

Comparar ficheros binarios en GNU/Linux - Compare binary files in GNU/Linux

Muchos usamos el comando diff para comparar ficheros de texto, pero qué pasa con los binarios? Para comparar ficheros binarios en GNU/Linux existen varios métodos (como para casi todo). Aquí comento alguno de ellos.
cmp:
bdispatcher@laptop:~$ cmp file1 file2
file1 file1 are different: byte 1, line 1

md5sum:
bdispatcher@laptop:~$ md5sum file1 file2
2fb1a6b293505c585a4fd75435dbf9a6  file1
e16c85c2851b2bee7a57167dbf05872b  file2

To compare two text files we can use the command diff, but what about the binary files? As we know, there are some different ways in GNU/Linux to achieve our objetive. Those are just two of them:

cmp:
bdispatcher@laptop:~$ cmp file1 file2
file1 file1 are different: byte 1, line 1

md5sum:
bdispatcher@laptop:~$ md5sum file1 file2
2fb1a6b293505c585a4fd75435dbf9a6  file1
e16c85c2851b2bee7a57167dbf05872b  file2

PS. I know, I know. My English is not good enought but, the more you help me, the more I learn.