chmod for directory and subdirectory in linux code example
Example 1: chmod recursive
-R, --recursive
chmod -R 755 /path/to/directory
Example 2: chmod folder recursive
chmod -R MODE DIRECTORY
#Example
chmod -R 755 /var/www/html
Example 3: how to give permission recursively in linux
chmod -R u=rwx,go=rx /tofile_path
Example 4: find change permissions to subdirectories
sudo find /var/www/html -type d -exec chmod 755 {} \;