On Thu, 7 Jun 2001, Nail, Larry wrote: That will miss files named .snapshot, and exec chown for each file. Try this instead:
find . -type d -name .snapshot -prune -o -user 444 -print | xargs chown -h 555
The above won't handle filenames with whitespace, so if you have
POSIX find and xargs, try this:
find . -type d -name .snapshot -prune -o -user 444 -print0 | xargs -0 chown -h 555
And if you have solaris and don't mind using undocumented syntax, you can do this...
/usr/bin/find . -type d -name .snapshot -prune -o -user 444 -exec /usr/bin/chown -h 555 {} +
The exec will *not* run every time. It will do an xargs type bundling and run once for multiple files. Handy if you haven't installed extra find and xargs programs...