How alike/different are two binary files

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have some media files (right now it's video files, but I suspect I would also be able to use a good solution on picture files), that are very similar, but according to diff/cmp not identical. But if it's only a few bytes that differ I might not be able to tell the difference (I know that depends lot on several things, let's ignore that). Does a program exist (preferably in Debian Stretch) that can output (an estimate of) how many bits/bytes in two files differ?
linux diff
add a comment |Â
up vote
1
down vote
favorite
I have some media files (right now it's video files, but I suspect I would also be able to use a good solution on picture files), that are very similar, but according to diff/cmp not identical. But if it's only a few bytes that differ I might not be able to tell the difference (I know that depends lot on several things, let's ignore that). Does a program exist (preferably in Debian Stretch) that can output (an estimate of) how many bits/bytes in two files differ?
linux diff
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have some media files (right now it's video files, but I suspect I would also be able to use a good solution on picture files), that are very similar, but according to diff/cmp not identical. But if it's only a few bytes that differ I might not be able to tell the difference (I know that depends lot on several things, let's ignore that). Does a program exist (preferably in Debian Stretch) that can output (an estimate of) how many bits/bytes in two files differ?
linux diff
I have some media files (right now it's video files, but I suspect I would also be able to use a good solution on picture files), that are very similar, but according to diff/cmp not identical. But if it's only a few bytes that differ I might not be able to tell the difference (I know that depends lot on several things, let's ignore that). Does a program exist (preferably in Debian Stretch) that can output (an estimate of) how many bits/bytes in two files differ?
linux diff
linux diff
edited Aug 26 at 9:41
GAD3R
22.9k164895
22.9k164895
asked Aug 26 at 7:36
Henrik
3,2891418
3,2891418
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
The cmp program (unless you suppress its output with the -s option) lists the differing bytes. You could get a count by piping that into wc, e.g.,
cmp -l foo bar | wc -l
The -l option tells it to list all differences. To account for different lengths, you'd have to make a more complicated script, since cmp doesn't report that part.
The-loption tocmpseems very much like what I want, wonder why I didn't check the man page.
â Henrik
Aug 26 at 9:54
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
The cmp program (unless you suppress its output with the -s option) lists the differing bytes. You could get a count by piping that into wc, e.g.,
cmp -l foo bar | wc -l
The -l option tells it to list all differences. To account for different lengths, you'd have to make a more complicated script, since cmp doesn't report that part.
The-loption tocmpseems very much like what I want, wonder why I didn't check the man page.
â Henrik
Aug 26 at 9:54
add a comment |Â
up vote
2
down vote
accepted
The cmp program (unless you suppress its output with the -s option) lists the differing bytes. You could get a count by piping that into wc, e.g.,
cmp -l foo bar | wc -l
The -l option tells it to list all differences. To account for different lengths, you'd have to make a more complicated script, since cmp doesn't report that part.
The-loption tocmpseems very much like what I want, wonder why I didn't check the man page.
â Henrik
Aug 26 at 9:54
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
The cmp program (unless you suppress its output with the -s option) lists the differing bytes. You could get a count by piping that into wc, e.g.,
cmp -l foo bar | wc -l
The -l option tells it to list all differences. To account for different lengths, you'd have to make a more complicated script, since cmp doesn't report that part.
The cmp program (unless you suppress its output with the -s option) lists the differing bytes. You could get a count by piping that into wc, e.g.,
cmp -l foo bar | wc -l
The -l option tells it to list all differences. To account for different lengths, you'd have to make a more complicated script, since cmp doesn't report that part.
answered Aug 26 at 8:17
Thomas Dickey
50.2k587157
50.2k587157
The-loption tocmpseems very much like what I want, wonder why I didn't check the man page.
â Henrik
Aug 26 at 9:54
add a comment |Â
The-loption tocmpseems very much like what I want, wonder why I didn't check the man page.
â Henrik
Aug 26 at 9:54
The
-l option to cmp seems very much like what I want, wonder why I didn't check the man page.â Henrik
Aug 26 at 9:54
The
-l option to cmp seems very much like what I want, wonder why I didn't check the man page.â Henrik
Aug 26 at 9:54
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f464883%2fhow-alike-different-are-two-binary-files%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password