How to compare two files in different volumes to ensure they are bit-for-bit identical?

Discussion in 'Mac OS X' started by Rafagon, Jul 11, 2014.

  1. Rafagon

    Rafagon Genius
    Gold

    Joined:
    Dec 7, 2011
    Likes Received:
    1,236
    On occasion, (since I do manual backups of lots of files by copying them instead of using Time Machine), I would like to have the ability to compare two files and have OS X tell me if there are identical bit-for-bit or not.

    (1) Basically, this method seems perfect, but I don't know how to get "Developer tools." I downloaded and installed Xcode 5.1.1 thinking that would do the trick (after all, Xcode should contain Developer tools, since it is used for developing), and I also launched Xcode and then quit out of it, but it did not enable the menus shown in the article:

    mergelocation.png
    (2) There's this method using Terminal, but from what I can see, it's for comparing text files only. I need to be able to compare files that aren't simply text—for example, I need to be able to compare two huge Excel spreadsheets or Word documents and ensure that they are carbon copies of each other. Complicating things further for me, I need to compare files that reside in one volume with files that reside in another volume. I could simply copy the source file and overwrite the existing destination (backup) file, thus ensuring they be identical, but sometimes I don't want to copy a huge file if I've only made a tiny change to the source file (my 2009 iMac has USB 2.0 ports so copying huge files from one volume to another isn't necessarily a quick thing to do).

    (3) Then there's this method, but it costs $40.

    (4) I downloaded Xfolders, which claims to be able to compare binary files, and it's a Universal app, and it did in fact start up perfectly, but when I went into the Preferences menu, it doesn't render properly. I have no clue what those checkmarks are on, because, as you can see, the text that should show beside the checkmarks just doesn't show up:

    Screen Shot 2014-07-11 at 9.09.18 PM.png

    (5) Finally, there's the old HexEdit application, but it is not Intel-native.

    The article I linked to under method (1) states that "So it appears as though Apple includes a free file comparison application with developer tools. Developer > Applications > Utilities > FileMerger"

    I searched for an application called FileMerger on my hard drive using spotlight (after installing Xcode) and it was nowhere to be found.

    I find it quite hard to believe that Apple doesn't provide a native way to compare two files to ensure they are identical. Comparing two files to ensure they're identical has been available since the days of DOS (before Windows ever existed). I'm not ready to spend $40 to compare two binary files.

    So, any OS X- or Terminal-savvy folks know how I could compare two binary files that reside on two different physical volumes?

    Any help would be greatly appreciated.
     
  2. silvermoon

    silvermoon Evangelist
    Gold

    Joined:
    Jul 17, 2013
    Likes Received:
    179
    I'm not that Mac savvy but I found a couple of ways on the terminal. If you have Vim installed, you can use vimdiff. The other command that might do what you want is comm.

    There is also a Compare Files app.
     

Share This Page