How do I add permissions to group to match user permissions?

Solution 1:

You can copy permissions:

chmod -R g=u /usr/local

This will copy the user permissions to the group permissions.

Solution 2:

cd /usr/local
chmod -R g-rwx .
find . -perm -u+r -exec chmod g+r {} \;
find . -perm -u+w -exec chmod g+w {} \;
find . -perm -u+x -exec chmod g+x {} \;

This first clears the group permissions from all files. Then it should search down, examining each file for each of the three user permission bits in turn (r, w, x). For each permission, when it finds a file that has that bit set (disregarding their other user permission bits), it sets the equivalent group bit on for that file.

I strongly advise you to test this on a random subdirectory first, preferably with some corner-case files in it that you make yourself. But it works in my comparable tests.