Skip to content

Instantly share code, notes, and snippets.

@alexanderschnitzler
Last active February 24, 2017 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save alexanderschnitzler/e77dc8723d77d97ca00b to your computer and use it in GitHub Desktop.
Save alexanderschnitzler/e77dc8723d77d97ca00b to your computer and use it in GitHub Desktop.
for folder in $(find fileadmin typo3conf typo3temp uploads -type d); do chmod 2770 $folder; done;
for file in $(find fileadmin typo3conf typo3temp uploads -type f); do chmod 0660 $file; done;
# As Markus Blaschke pointed out there is a way better solution to this. Thanks!
# https://twitter.com/MarkusBlaschke
find fileadmin -type d -print0 | xargs -0 chmod 2770
find fileadmin -type f -print0 | xargs -0 chmod 0660
@marble
Copy link

marble commented Apr 8, 2014

Ich usually use:

find fileadmin -type d -exec chmod 2770 {} +
find fileadmin -type f -exec chmod 0660 {} +

or, even more universal, but slower:

find fileadmin -type d -exec chmod 2770 {} ;
find fileadmin -type f -exec chmod 0660 {} ;

See some details about pros and cons: http://en.wikipedia.org/wiki/Xargs

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