Directory structure compare
There’s gotta be a better way. But after a horrible upgrade process for a horrible commercial open-source product, I need to see which sub-directories from the old installation are missing in the new one. Don’t ask. I’ve literally been having nightmares about this upgrade.
Anyway, given tree1
and tree2
under some common point, I want a list of directories that exist in tree1
and don’t exist in tree2
.
Here was my clumsy way of solving the problem.
cd tree1
find . -type d -print | sort > ../dirs_old
cd ../tree2
find . -type d -print | sort > ../dirs_new
cd ..
comm -23 dirs_old dirs_new
Leave a Reply