Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got two large directory trees--think years of client work for an agency. One is old and out of date; the other is larger and in current use. I'd like to delete the former, but I want to be sure that the latter is truly a superset of it (I suspect the former is an old archive or early edition of the latter that was carelessly copied and never deleted).

Using diff in its usual configuration would produce waaaaay too much output, because it would tell me about all the differences between the two directory trees. What I'd like to know is what command I could run to find out what files (if any) are on the smaller, older tree, that are not also available on the larger, newer tree.

Incidentally, I'm running cygwin on Windows--not sure it matters. If anyone would suggest using a windows utility instead, that's fine too.

share|improve this question
This question might belong on Super User. – Peter Eisentraut Jan 8 '10 at 15:43
up vote 1 down vote accepted

Beyond Compare is, literally, beyond compare for this type of task. It makes comparing directories trivial. It will show you the files in a view where you can then select them and copy them either somewhere else, or into the newer tree.

If your data set is as you suspect, it will simply show an empty view on the old side, and you know there's nothing you need to do.

share|improve this answer

Robocopy is what you want for a windows utility.

robocopy.exe <your old dir tree> <your new dir tree> /COPYALL /L

You can add other options, but make sure the /L is there, or it will actually merge the two trees instead of just comparing the differences.

share|improve this answer
olddir$ for file in $(find -type f); do [ -e $NEWDIR/$file ] || echo "$file is missing in NEWDIR"; done
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.