Change Permissions or Ownership of Files or Directories Recursively

,

So I am always looking for the way to change all files or directories in a directory to a certain set of permissions.  Here are the following shell commands that you can use to accomplish it.

# For Directories
find ./ -type d -exec chmod 755 {} +
# For Files
find ./ -type f -exec chmod 644 {} +

To change the ownership of files recursively you can use the following command

chown -R username:groupname ./*

 

 

Skills

Posted on

May 4, 2015

Submit a Comment

Your email address will not be published. Required fields are marked *