How to recursively change permissions on all directories inside current directory?

You're missing a space after 644.

Also, 644 is probably not what you want on a directory. You probably want 755.

Edit to include answer from comments below:

For directories:

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

For files:

find . -type f -exec chmod 644 {} \;

There's very likely other ways (maybe shorter) to do this, but this will work.


Another way to do this is:

chmod -R u=rwX,g=rX,o=rX /path/to/dir

The capital X is a conditional execute- if the file is a directory the execute bit gets added OR if the file is already executable the execute bit gets retained.

Though this would add permissions to non directory files. If these permissions are acceptable, this works for quickly adding access to folders.

Tags:

Find

Chmod