Title photo
frugal technology, simple living and guerrilla large-appliance repair
Mon, 29 Jan 2018

How to change permissions on all directories in a directory while leaving the files alone

I have a situation where I want all of the directories in my project to have 755 permissions while all files have 644 permissions.

All of the files have the same extension, so it's easy to single them out:

$ chmod 644 *.txt

But what do you do for directories? I did a search, and a Linux Questions thread gave me the answer:

$ find . -type d -exec chmod 755 {} \;

Works like butter.