4

Here's my deal in a nutshell:

I use a Macbook and a PC, where I sync 2-3 large folders between the two with Windows Live Mesh.

About 5 days ago my Macbook battery died, and I just upgraded to a Macbook Pro. Upon running Windows Live Mesh, it gives me an error that I worked on for a day and couldn't figure out. I need file syncing so I decided to upgrade my Dropbox account to 50GB.

However, my Windows PC surely has a handful of files that have been updated in that period, plus I have used my Macbook Pro to edit a few files within these folders before I upgraded Dropbox.

Last night I moved all the synced folders on my Windows PC to the Dropbox and let that sync to my Macbook overnight. Now I have the Mac version of the synced folders on my desktop, and the Windows version of the synced folders in my Dropbox.

Is there a way to compare the contents of these two folders on my Macbook Pro to determine which files have been changed, and which folder contains the most recent version?

Judith
  • 673
  • 4
  • 18
delvec
  • 43
  • 1
  • 5

3 Answers3

3

Just open Utilities » Terminal.app, and use the diff command to compare two folders.

For example, if you have the contents:

  • test1

    • file1
    • file2
    • file3
  • test2

    • file1 (modified)
    • file3

The command diff test1 test2 will output:

Only in test1: file2
Binary files test1/file1 and test2/file2 differ

This way you can see which files are different from each other (in a "binary" way, e.g. changed contents), or which files don't exist in either folder. You can pass the -r option to recursively search subdirectories, and read man diff for more details.

In your case, that would be something like: diff -r ~/Desktop/Dropbox ~/Dropbox

slhck
  • 223,558
  • 70
  • 607
  • 592
  • Sweet, i was just looking up this command but wasn't sure if it was only for added files or changed contents as well. Thanks! – delvec Nov 12 '11 at 18:55
3

If you install the OS X development tools (through app store or on a disk that came with your computer), you can use the FileMerge app – also launchable through the command utility opendiff.

enter image description here

There's an intro with screen shots in this blog post (not my blog, just found it through Google).

slhck
  • 223,558
  • 70
  • 607
  • 592
Doug Harris
  • 27,333
  • 17
  • 78
  • 105
  • That's nice, I somehow forgot about this – should be easier for people who like to work in the GUI. – slhck Nov 15 '11 at 16:48
1

Compare Folders is the best program that I have found for this task. It's very easy to use and with a simple GUI.

Its trial allows you to do 9 free comparisons.

slhck
  • 223,558
  • 70
  • 607
  • 592
space_balls
  • 121
  • 1
  • 1
  • 4
  • 1
    Consider adding more information about the linked program so that the post remains useful should the link become invalid. In addition, if you have an affiliation, please disclose it so that this isn't seen as spam. – bwDraco Oct 08 '12 at 05:23
  • 1
    I'll let this stay for the moment, but please read: [How do I recommend software in my answers?](http://meta.superuser.com/questions/5329/how-do-i-recommend-software-in-my-answers) – slhck Oct 08 '12 at 07:49
  • eh I didn't know there was a limitation. Had it for years – space_balls Oct 12 '12 at 04:49