Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How can I compare two directories with sub dirs to see where is the difference?

share|improve this question
Operating System please. –  Jimmy Shelter Feb 9 '10 at 15:22
Are you wanting to know if there are different files between the two directories or if the contents of the files are different? –  Matt Simmons Feb 9 '10 at 17:19
add comment

5 Answers

up vote 15 down vote accepted

Under Linux:

$ diff -r /first/directory /second/directory

Under Windows: you'd probably better download and install WinMerge, then

> WinMerge /r c:\first\folder c:\second\folder


share|improve this answer
I use diff -qrl now... –  alexus Aug 10 '11 at 19:28
Is there an option in the GUI to specify the /r switch without using the command prompt? –  Omtara May 7 '13 at 3:31
@Omtara, after you have started WinMerge, choose File - Open. In the open dialog, check //Include Subfolders//. If you open WinMerge by selecting two folders in the Windows Explorer, configure Shell integration. Open Edit - Options; navigate to Category //Shell Integration and check //Include subfolders by default//. –  R. Schreurs Apr 8 at 15:26
add comment

Beyond Compare is a good commercial tool, $30 or so. Runs under windows, has an eval version. http://www.scootersoftware.com/

share|improve this answer
add comment

I used meld on Ubuntu - it has a good directory comparison option.

share|improve this answer
add comment

On Windows, I believe windiff does it, however Winmerge is my tool of choice for this job. It's open source and does a very neat job of comparing two sets of directory trees.

edit: oops, was beaten to it by Marius

share|improve this answer
add comment

DiffMerge for Windows shows differences including subfolders in a window. There is also a portable version somewhere but a quick search revealed this download: http://www.softpedia.com/get/System/File-Management/SourceGear-DiffMerge.shtml

Greetz, GHad

share|improve this answer
add comment

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.