Linux: Binary comparison with "cmp"
Posted: Mon Jan 19, 2015 2:53 pm
Usually I use "vbindiff" for binary file comparison, but on RedHat (RHEL) systems, it doesn't seem to be in the default repositories.
Thanks to an answer on "superuser.com", I found a substitute by using "cmp":
That outputs a listing with 3 columns:
If you want to count the differences, you can use "wc" in line-mode:
Links:
Thanks to an answer on "superuser.com", I found a substitute by using "cmp":
Code: Select all
$ cmp -l file1.avi file2.avi
- byte offset
- value in first file
- value in second file
It's not as beautiful to read/interact with as vbindiff, but at least it gives you a hint of what's going on.230858726 0 243
230858727 0 266
230858728 0 125
230858729 0 316
230858730 0 117
230858731 0 302
230858732 0 65
If you want to count the differences, you can use "wc" in line-mode:
Code: Select all
$ cmp -l file1.avi file2.avi | wc -l
Links: