Chmod files to recursively give group same permissions as user

Is there a unix command to give the group the same permissions as the user currently has on a file-by-file basis recursively for a directory tree? I.e. if a file is user writeable it should become group writeable, otherwise it should not be group writeable and so on.


Solution 1:

Kudos to jamessan for showing us g=u. On my system, this seems to work:

chmod -R g=u dir

Solution 2:

find dir -type f -exec chmod g=u '{}' \+