Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

There are some good free file compare programs out there and most of them will compare directories too. But what I am look for is one where I can specify a filter like *.cpp and have it ignore object files, makefiles, executables, etc without me having to manually remove those before compare.

Any suggestions?

share|improve this question
Doesn't Notepad++ provide this? –  Aditya P May 5 '11 at 6:56

4 Answers 4

up vote 6 down vote accepted

I swear by WinMerge. It's free, it can compare directories, and you can set up filters by file extension: see Filters for documentation.

share|improve this answer
+1 Winmerge is great for folder+file comparision. As a C/C++ programmer I dont even need to look for alternatives. –  DPD May 5 '11 at 5:18
+1: I don't need to use WinMerge often, but man when I do it's a real pig hoarder! Sorry, I mean bacon saver :) –  Binary Worrier May 5 '11 at 7:07
+1 Thanks, I must have overlooked that. I'll check it & get back to you –  Mawg May 5 '11 at 12:18

Check out Beyond Compare. It's good for this and a whole lot more. $30 and worth every penny.

Update: Yes, it works for the problem stated. Do the following:

  1. Session > New > Folder Compare
  2. Pick you left and right folders.
  3. Set your filter rules. There are a few predefined rule sets, including C++ Source, which has "*.cpp;*.hpp;*.c;*.h;*.cc". Note you can name and save your filter sets so you only have to define them once.
  4. You can now pick "compare for equal", "compare for not equal", "sync left", "sync right", etc., etc.
  5. You can save the session and rerun it again with a couple of clicks.

This program also works great for doing targeted backups. If it hits a file that it can't copy, it notes it in the message box and keeps rolling, unlike Windows copy which dies on the first error.

They have a non-crippled 30 day trial.

Ps. I know I probably sound like a shill for Scooter Software, but I'm not. I'm mostly an old Unix hacker who every once in a while has a need for decent compare/sync for Windows machines.

share|improve this answer
For those stuck on Windows this is a class leader and a must have tool, it is almost enough reason to use Windows for development on purpose, if it wasn't for that whole cygwin thing to make Windows actually useful! –  Jarrod Roberson May 5 '11 at 5:12
+1 best Windows compare software ever ;) –  Demian Brecht May 5 '11 at 6:45
I bought it X years ago. I have v2 & am aware that there is a V3. Are you saying that this answers the question, or just that it is good. Specifically - can I tell it to compare all files in a directory & all sub-directories with a given extension, ignoring all files of other extensions? –  Mawg May 5 '11 at 12:18

ack is my go-to tool for this on Linux and OS X. I've never used it on Windows before, but this stackoverflow answer seems to cover it well.

share|improve this answer

All the features you need are in Araxis Merge, it's not free, but it has a 30-day trial version.

From Excluding files and folders from a comparison:

You can specify wildcard expressions to exclude files and folders from the folder comparison. Files and folders that are excluded in this way will not be compared and will not appear in the results list even when you choose the Show Hidden Items command. You can use this feature to exclude large binary files or entire folder hierarchies from the comparison.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.