Use the command below to recursively change permissions only on files:
~$ find /<path> -type f -exec chmod 644 {} \;
While use the following command to recursively change permissions only on directories:
~$ find /<path> -type d -exec chmod 755 {} \;
where:
– /<path>
is the path containing the interested files or directories.
– 644
assigns permissions of “read/write” on the owner, while “read” on the group and others.
– 755
assigns permissions of “read/write/execute” on the owner, while “read/execute” on the group and others.