

For this, you'll use the pipe (">") command, like so: diff -rq > /Users//Desktop/comparison.txt This is often much easier to read and work with, but it does require you to be a bit familiar with things like paths.

That tells me which lines are different and how.įinally, just as with a lot of Terminal commands, you can send the results to a file instead of just into a Terminal window. diff -rq Īdditionally, you can use diff to compare files instead of folders by dragging a couple of those onto Terminal instead: This makes your results much easier to read! Of course, you can combine this with the "-r" option, too. For example, you can use the "-r" option to force the command to search all subfolders, like so: diff -r Īnother often-used choice is "-q," which'll output less-detailed text that only tells you whether files differ and not how they differ. So that's all pretty handy, but you have a few options you can add on, too, to make things even better. (I typed "text differs" within one of them to show you how it'd look.) In the window that appears, you'll configure your rule I see that one file only lives in the copy and is missing from the original folder: Only in /Users/melissa/Desktop/TMO Copy: Account Info.jpgĪnd I also find that a text file has different content than its counterpart: 7c7,9 From it, I can tell that I've got two JPEG files with the same name but different content: Binary files /Users/melissa/Desktop/TMO/20130524 Table.jpg and /Users/melissa/Desktop/TMO Copy/20130524 Table.jpg differ The thing is, though, that the gobbledygook is pretty interesting.

Press Return to implement the command, and your Terminal window will fill with delicious data. That'll make Terminal fill in the paths to those folders for you, and you should see something like this: It doesn't matter what order you do this in, and you don't have to type a space in between, either. When you've got it ready to go, type diff in at the prompt followed by a space, and then drag the two folders you want to compare and drop them on the Terminal window. It's accessed through the Terminal, so first you'll open that program from your Applications> Utilities folder. A lot of folks don't know that there's a built-in way to do that, and it's pretty easy to use and understand.

Let's say you've copied an older version of a folder off of your backup drive, and you need to find out how its contents compare to the current version on your Mac.
