Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 directory with lots of files and inside a mounted directory.

   nfs/ (a NFS remote directory)

How can I chmod/chown everyfiles inside that directory without changing nfs ones.

share|improve this question

Well my solution was to use find to do that:

find . -xdev -exec chown myuser:mygroup {} \;
share|improve this answer
You could make that a bit faster by doing something like: find . -xdev -exec chown myuser:mygroup {} \+ – Bill Weiss Aug 8 '13 at 17:06
and I prefer combining find with -exec rather than piping it to xargs (check here ) for a bit of background... – Petter H Aug 8 '13 at 19:14
\+ or \; here find . -xdev -exec chown myuser:mygroup {} \; – Natim Aug 12 '13 at 8:02

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.