0

I have a directory structure like:

foo
 |__bar
     |__bin
     |   |__tmp
     |
     |__bez
         |__tmp

I need to find the tmp directory in bin/tmp, but not the one in bez/tmp. It seems to me that find only operates on the name of one directory or file at a time. Is there a command that will return me the path to the tmp directory in bin, but not the one in bez? It's a bonus if the command finds all bin/tmp folders, as there may be many in the directory tree.

Many thanks!

  • 2
    What is the OS? – MB34 Jun 19 '13 at 14:45
1
find ./foo/ -type d -path '*/bin/tmp'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.