3

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.

1 Answer 1

4

Well my solution was to use find to do that:

find . -xdev -exec chown myuser:mygroup {} \;
3
  • 4
    You could make that a bit faster by doing something like: find . -xdev -exec chown myuser:mygroup {} \+
    – Bill Weiss
    Aug 8, 2013 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, 2013 at 19:14
  • \+ or \; here find . -xdev -exec chown myuser:mygroup {} \;
    – Natim
    Aug 12, 2013 at 8:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .