Skip to content

Instantly share code, notes, and snippets.

@crittermike
Last active October 19, 2024 14:50
Show Gist options
  • Save crittermike/dd12cfaa69d4d2299f6a907ea8667ed5 to your computer and use it in GitHub Desktop.
Save crittermike/dd12cfaa69d4d2299f6a907ea8667ed5 to your computer and use it in GitHub Desktop.
How to chmod only directories

Use chmod +X (as opposed to +x) which will make only directories executable and leave files alone.

This is great for recursively fixing a Drupal files directory. For example:

chmod -R 664 sites/default/files && chmod -R a+X sites/default/files

That will make all your files writeable by you and the server, but not executable, but will also make directories executable (i.e., listable).

@Appoxo
Copy link

Appoxo commented Oct 19, 2024

Fucking hell permissions. THANK YOU <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment