Skip to content

Instantly share code, notes, and snippets.

@directionforward
Forked from bzerangue/recursive-chmod.md
Last active November 22, 2022 23:11
Show Gist options
  • Save directionforward/6b5f3e3af2a8c8644d9439ffb466a054 to your computer and use it in GitHub Desktop.
Save directionforward/6b5f3e3af2a8c8644d9439ffb466a054 to your computer and use it in GitHub Desktop.
Scripts for recursively chmod directories only and recursively chmod files only

Useful commands

You may find these commands useful when adjusting file and directory permissions.

To recursively chmod directories only for single user permissions:

find /your/site/root -type d -exec chmod 755 {} \;

To recursively chmod directories only for group users permissions:

find /your/site/root -type d -exec chmod 775 {} \;

To recursively chmod files only for single user permissions:

find /your/site/root -type f -exec chmod 644 {} \;

To recursively chmod files only for group users permissions:

find /your/site/root -type f -exec chmod 664 {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment