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

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

3 Answers 3

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

 
discard

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.