Currently, when I want to change owner/group recursively, I do this:find . -type f -exec chown <owner>.<group> {} \;find . -type d -exec chown <owner>.<group> {} \;But that can take several minutes for each command. I heard that there was a way to do this so that it changes all the files at once (much faster), instead of one at a time, but I can't seem to find the info. Can that be done?
A quicker way to change owner/group recursively?
linux;shell;command line;terminal;chown
Use chown's recursive option:chown -R owner:group * .[^.]*Specifying both * and .[^.]* will match all the files and directories that find would. The recommended separator nowadays is : instead of .. (As pointed out by justins, using .* is unsafe since it can be expanded to include . and .., resulting in chown changing the ownership of the parent directory and all its subdirectories.)If you want to change the current directory's ownership too, this can be simplified tochown -R owner:group .