Steps to change permission to files and folder with Find command

kumkumsharma

Administrator
Staff member
If you want to change the permissions of files or folder in bulk then you can use “find” command. You can follow below steps to
  • You have to change directory for which we need to change the permissions.
  • You can change the directory permission to 755 and file permission to the 644, so we have to customize command according to it.
If we need to change permission of all files under directory to 644 then we need to run below command.

Code:
find . -type f -exec chmod 644 {} \;
if we need to change permission of all directories under folder to 755 then you can run below command:

Code:
find /home/abc/ -type d -exec chmod 755 {} \;
if you want to change permission of all the files under folder having 777 permission to 644 then use below command:

Code:
find . -type f -perm 777 -exec chmod 644 {} \;
 
Top