[svlug] How do I recursively chmod 0664 files but not directories?

K. Ari Krupnikov ari at lib.aero
Thu Jul 14 12:12:40 PDT 2005

"Daevid Vincent" <daevid at daevid.com> writes:

> I accidentally typed "chmod -R 0775 /mydir", so now all directories AND
> files are +x
> What magical bash incantation can I type to recursively go through and make
> all files 0664 but make directories 0775?

Not the cleanest, but I'd use

chmod 0664 `find /mydir -type f`


Elections only count as free and trials as fair if you can lose money
betting on the outcome.

More information about the svlug mailing list