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
other
permissions byfind . -perm /o=rwx
. You need a script after-exec
to perform the correctchmod
.