Home > Mobile >  Combine two find commands
Combine two find commands

Time:04-19

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

CodePudding user response:

this should work :

find -type d \( -name "secrets" \) -execdir find {} -type f -name "*.tar.gz" \;
  • Related