Artificial intelligent assistant

change permissions with find for specific files Let's say I have a directory called permissions, that contains several files with different access rights. What I want to do is if a file has access rights for `others` category, I want to accord the same access rights for the `group` category. example1: if file_1 has `r-x---r--`, then I want that file to have the permissions `r-xr--r--` example2: file_2 has `r-xr----x` rights, I want it to become `r-xr-x--x` example3: file_3 and file_4 have `rw---x---` and `rwxr-----` access respectively, these files should stay unchanged I know with `find` I can search for such files with `-perm 0740` then `-exec chomd --- \;` to change their value, but how to search only the files that have `other` permissions different than `group` permission, and when found, change their `group` access rights to match `other` rights

`chmod` can do this by itself:


chmod -R g+o dir


> A combination of the letters `ugoa` controls which users' access to the file will be changed: [...] other users in the file's group (g), [...]
>
> The operator + causes the selected file mode bits to be added to the existing file mode bits of each file [...]
>
> The letters `rwxXst` select file mode bits for the affected users [...] Instead of one or more of these letters, you can specify exactly one of the letters `ugo`: [...] and the permissions granted to users that are in neither of the two preceding categories (o).

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy f5de7d0f809dc745d989bf232cac4908