How to change the permissions of files in a directory recursively

Ralf Mardorf silver.bullet at zoho.com
Mon Apr 24 22:52:24 UTC 2017


On Mon, 24 Apr 2017 18:11:34 -0400 (EDT), Robert Heller wrote:
>> >> How can I leave the permission of a directory at 755 and change
>> >> the permissions of all of it's files to 766? Everything I have
>> >> tried and what I have found googling ends up setting the dir and
>> >> file permissions the same.  
>That would have *failed* to change dotfiles (.htaccess for example).
>It would also have changed and the *subdirectories* to 766 -- I don't
>know if that is your intent or not.

Globbing not always is an issue, but if you wouldn't have pointed this
out, I would have mentioned globbing.

I would simply change all permissions recursively to 766 and after that
only revert the directory to 755.






More information about the ubuntu-users mailing list