How to apply permissions change command to all files in the directory including all its subdirectories tree? Separately to the files and separately to the directories?
Mass files or folders permissions change
(2 posts) (2 voices)-
Posted 6 months ago #
-
You need to use
findcommand together withchmod.
For example, if you need to set 644 permissions to all files in the current directory including all its subdirectories use this commandfind . -type f -exec chmod 644 {} \;if you need to set 755 permissions to all subdirectories in the current directory use this command
find . -type d -exec chmod 755 {} \;More examples for typical usage of
findcommand can be found here, at
find examples page.To change files and directories owner use this command
chown -Rv username somedir
To change files and directories group use this command
chgrp -Rv groupname somedir
Posted 6 months ago #
Reply
You must log in to post.