The chown command in Linux may be used to alter the ownership of a directory or a file. This is critical when using scripts or utilities that need certain rights or ownership in order to perform their functions.
This is critical. An excellent example is WordPress’s automatic updating feature. WordPress requires www-data ownership in plugin directories and files.
The chown command can be made to work properly if you observe that ownership isn’t being passed down to subfolders and files.
How to CHOWN all Subfolders and Files?
The -R switch is all that is needed to ensure that chown changes ownership of subfolders and files. Recursively changing ownership is what this move entails.
chown -R USER:GROUP FOLDER
chown -R www-data:www-data wp-plugin-folder
That’s all there is to it. To see other switches you can use with chown you can view its documentation.