I'm trying to update the ownership of everything in a directory tree from me to root. I'm using find to do it a little more carefully than a recursive chown.Here are the commands I use to change ownership of all files and directories in my tree:cd /opt/mydir# Update filessudo find . -type f -execdir chown root:root {} +# Update directoriessudo find . -type d -execdir chown root:root {} +These work fine for all files and directories. But I noticed there are symbolic links in /opt/mydir that point to files somewhere in the same directory tree, that I still retain ownership of.For example:lrwxrwxrwx  1 civfan civfan      6 Jul 18  2013 halt -> reboot-rwxr-xr-x  1 root   root    14832 Jun 25  2013 rebootThis looks wrong and seems likely to cause me permission problems later if I don't fix it now.How do I change ownership of all symbolic link files, too?
How do you use 'find' to update ownership of all directories, files, and symbolic links in a folder?
files;permissions;find
The ownership of symbolic links don't matter.  Its the referenced entitiy which does.That said, use find -l to discover symbolic links in a directory tree.Use chown -h and/or chmod -h to operate on the symbolic link.find . -type l -exec chown -h root:root {} +