On Thu, 7 Jun 2001, Nail, Larry wrote:
Lets assume that I am changing the UID of all files and directories, within the current directory, from 444 to 555 and that I do not want my find command to run through the .snapshot directory.
find . -name .snapshot -prune -o -user 444 -exec chown -h 555 {} ;
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