Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a directory with lots of files and inside a mounted directory.

var/
   log/
   nfs/ (a NFS remote directory)
   www/

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

share|improve this question

1 Answer 1

Well my solution was to use find to do that:

find . -xdev -exec chown myuser:mygroup {} \;
share|improve this answer
3  
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 stackoverflow.com/questions/896808/find-exec-cmd-vs-xargs ) 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

 
discard

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.