I noticed:
chmod -R a+x
adds execute permissions to all files, not just those who are currently executable.
Is there a way to add execute permissions only to those files who already have an execute set for the user permission?
777 - all can read/write/execute (full access). 755 - owner can read/write/execute, group/others can read/execute. 644 - owner can read/write, group/others can read only.
Permissions of 644 mean that the owner of the file has read and write access, while the group members and other users on the system only have read access. For executable files, the equivalent settings would be 700 and 755 which correspond to 600 and 644 except with execution permission.
chmod 744 file1. sets read, write and execute for the owner and read only for the group and all others. chmod 777 file1. sets read, write and execute for everyone.
755 means read and execute access for everyone and also write access for the owner of the file. When you perform chmod 755 filename command you allow everyone to read and execute the file, the owner is allowed to write to the file as well.
Use find
:
find . -perm /u+x -execdir chmod a+x {} \;
You can use find to get all those files:
find . -type f -perm -o+rx -print0 | xargs -0 chmod a+x
Update: add -print0 to preserve space in filenames
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With