Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a document root folder and I want to cange the group of only the cache directories. How can I do this recursive?

The cache directories are always below templates/html, and I want to change it to wwwrun:www.

The folder structure looks like:

/blocks/element1/templates/html/cache1    root:root   <- this
/blocks/element1/lib/file.html            root:root
/blocks/element1/lib/file-xy.html         root:root
/blocks/element2/templates/html/cache1    root:root   <- this
/blocks/element2/templates/html/cache2    root:root   <- this
/blocks/element2/lib/file.html            root:root
/blocks/element2/img/icon.png             root:root
/blocks/element3/templates/html/cache2    root:root   <- this
/blocks/element3/logo.jpg                 root:root
share|improve this question
up vote 2 down vote accepted


find . -type d -name "cache*" -exec chown -R wwwrun:www {} \;

inside templates/html should do it.

share|improve this answer
I run it inside /blocks/. – powtac Aug 16 '11 at 8:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.