Quick tip: Compare folders in Mac OS X

By Adam Codega

Recently I’ve decided to move from Dropbox to Box. The free storage that Dropbox comes with isn’t enough for me and I don’t use a lot of their special features to make it worth keeping them. I simply keep all my files in one folder on my laptop and have it synced to Dropbox, where I have it installed on my basement file server. (I also backup the file server with Crashplan)

Also, as it turns out Box is running a promo right now. If you install their iOS app after creating an account your free storage space will be expanded from 10 GB to 50 GB.

So anyway.. the main point of this blog post. Switching was easy. I installed Box on my laptop and simply copy and pasted my Dropbox contents into the new Box folder. But then I got busy that afternoon and continued working on a few things in my Dropbox folder. Now I had to compare the two folders since I had worked on projects across a few different folders. I always used WinMerge and liked it on Windows computers. It has a nice GUI where it shows the two folder contents side by side and any files that don’t exist in both places, or who’s contents are different, are highlighted in red. I could use DiffMerge for OS X but only a few changes had been made so all I needed was the diff command from the terminal.

adam:~ adam$ diff -rq Dropbox "Box Sync"
Files Dropbox/.DS_Store and Box Sync/.DS_Store differ
Only in Dropbox: .dropbox.cache
Only in Box Sync: Engagement Disc
Only in Box Sync: Honeymoon Disc
Files Dropbox/Loop By Loop/mailing.txt and Box Sync/Loop By Loop/mailing.txt differ
Only in Dropbox/Loop By Loop/2x2_stamp: 2x2_stamp rounded.pxm
Only in Dropbox/Loop By Loop/2x2_stamp: 2x2_stamp_postal-seperate.idraw
Only in Dropbox/Loop By Loop/2x2_stamp: 2x2_stamp_postal-seperate.png
Only in Dropbox/Loop By Loop/2x2_stamp: 2x2_stamp_postal.idraw
Only in Dropbox/Loop By Loop/business cards: sheep.png
Only in Box Sync: Pixelmator brushes
Only in Box Sync: The-Secret-Weapon-Manifesto.pdf
Only in Box Sync: Wedding Disc
Only in Dropbox: codega-email.jpg
Only in Dropbox: codega.png
Only in Dropbox: holidays off.rtf
Only in Box Sync: passwords-suck.png
adam:~ adam$

 

With a small list of files that were different/only existed in Dropbox I went ahead and made my changes.  You can also see that since the folder “Box Sync” had a space in it’s name I enclosed it in quotes. I used two options, r makes diff also go into subfolders as well and q will provide me a brief summary of differences, helpful when comparing a lot of folders and files. Check out the other diff options over at Commands.com.