2

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.

1
  • This question might belong on Super User. Jan 8, 2010 at 15:43

3 Answers 3

1

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.

0

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.

0
olddir$ for file in $(find -type f); do [ -e $NEWDIR/$file ] || echo "$file is missing in NEWDIR"; done

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .