I have a directory with about 100 sub directories. Some of these sub directories are "Wordpress folders" others are not. What I would like to do is change the ownership of the themes and plugin directories inside the "Wordpress folders". I'm using this command to get the list of these directories:
find . -maxdepth 3 -type d | grep 'wp-content/themes\|wp-content/plugins'
How could I make change the ownership of all plugins and themes subdirectories?
find . -maxdepth 3 -type d | grep 'wp-content/themes'– koni_raid Nov 20 '17 at 08:48find . -maxdepth 3 -type d -path "*wp-content/themes*"and always add additional information directly to your question with [edit], but that still doesn't clarify much. What's the overall problem, what exactly do you want to achieve? Does thefindcommand list all the directories you want to modify? – dessert Nov 20 '17 at 08:55chown -R user:group */wp-content/themes? – muru Nov 20 '17 at 09:08find . -maxdepth 3 -type d -regextype posix-extended -regex '.*wp-content/(themes|plugins)' -exec echo chown -R User:Group {} \;. Tweak theUser:Grouppart. When the output looks sufficient removeechoto do the changes. – pa4080 Nov 20 '17 at 09:22