Reputation: 466
I'm looking to find the folder named - secrets
, under /home/build
, if found, check if it has a tar.gz file under it, recursively.
I tried some thing like below but it didn't work, how can I fix this ?
find -type d \( -name "secrets" \) -exec find . -type f -name "*.tar.gz"
OS - MacOS
Upvotes: 0
Views: 105
Reputation: 26935
this should work :
find -type d \( -name "secrets" \) -execdir find {} -type f -name "*.tar.gz" \;
Upvotes: 1