How alike/different are two binary files

The name of the pictureThe name of the pictureThe name of the pictureClash 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?










share|improve this question



























    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?










    share|improve this question

























      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?










      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 26 at 9:41









      GAD3R

      22.9k164895




      22.9k164895










      asked Aug 26 at 7:36









      Henrik

      3,2891418




      3,2891418




















          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.






          share|improve this answer




















          • 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










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          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






























          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.






          share|improve this answer




















          • 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














          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.






          share|improve this answer




















          • 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












          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 26 at 8:17









          Thomas Dickey

          50.2k587157




          50.2k587157











          • 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















          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

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          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













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)