Ubuntu – chmod directories and files in one command

chmoddirectoryfilespermissions

I have a directory "project" that contains a set of subdirectories and files. I want to give 777 permission to the directories and files from my 666 in the same directory with chmod command in my directory "projct". how I can do that ?

Best Answer

To do everything in one run:

find ./ \( -type d -execdir chmod 755 '{}' \; \) , \( -type f -execdir chmod 644 '{}' \; \)

This traverses the tree below the current directory just once and sets 644 on files and 755 on directories.