Apply conditional file permissions recursively, you need to use combination of the find and chmod command.
To find all files in /home/user/demo directory, enter: $ find /home/user/demo -type f -print To find all files in /home/user/demo directory with permission 777, enter: $ find /home/user/demo -type f -perm 777 -print Finally, apply new permission using the -exec option as follows: $ find /home/user/demo -type f -perm 777 -print -exec chmod 755 {} \; To select directories and subdirectories use the following syntax: $ find /var/www/html -type d -perm 777 -print -exec chmod 755 {} \;
Note. This article may break the knowledgebase when placed in Linux sub-catagory
« Go back
Powered by Help Desk Software HESK, in partnership with SysAid Technologies