UNIX Programming, Certification, System Administration Reference Books
What's the easiest way to compare 2 directories RECURSIVELY?

I wish Midnight Commander had some command for this, but you can easily adapt your own. Put this into your ~/.mc/menu file:
r       Recursively compare directories
        cd %d
        find . -type f -print0 | xargs --null ls -l | cut -c33-1000 | sort -t. +1 > /tmp/00mc_current
        cd %D
        find . -type f -print0 | xargs --null ls -l | cut -c33-1000 | sort -t. +1 > /tmp/00mc_other
        kdiff /tmp/00mc_current /tmp/00mc_other
        rm -f /tmp/00mc_current /tmp/00mc_other
Now, when you press F2 and 'r' the file listings of the directories in the two panels will appear inside kdiff. The script depends heavily on ls output format.

Return to : Unix System Administration Hints and Tips