Find command matching 2 directories

P

postcd

Guest
I cant figure out this :-(

I need to list all subdirectories of 2 folders which name match wp-content and wp-includes

i tried this:
find /home/username/public_html/ -path "*/wp-content/*" -o -path "*/wp-includes/*" -type d
find /home/username/public_html/ -type d -path "*wp-content*" -o -path "*wp-includes*"

but it lists files, not directories :-(
 


OP
P

postcd

Guest
i think this worked :-(

find /home/username/public_html -iname "*wp-content*" -o -iname "*wp-includes*" -type d -exec find {} -type d \;

if anyone please can explain where was the bug or how to do more simply, would be welcome, thx

PS: what if i want to execute an chmod for each of these found subdirectories?
 
Last edited:
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Members online

No members online now.

Top