I would like to change the ownership of all files and directories but exclude some directories:
find -user test ! -path "./dir1/*" ! -path "./dir2/*" -exec chown -R root:root {} \;
The ownership of the excluded directories is still changed?
Regards
.
, if it happens to be owned by usertest
, it will match, and then you're recursively chowning everything under that anyway.