find a folder nested in a folder
I'm not quite sure of what you are looking for but the following will list all directories named "Virtual Box" starting with the deepest nested to the least.
find /Volumes -type d ! -name Volumes -name "Virtual Box" 2>/dev/null
EDIT: OK, understanding your requirement a bit better we can use the path
predicate to match outerfolder/innerfolder
find /Volumes -type d -path '*outerfolder/innerfolder'
Assuming innerfolder
needs to be directly within outerfolder
:
find /Volumes -type d -name "outerfolder" -exec test -d {}/"innerfolder" \; \
-exec echo {}/"innerfolder" \;
(formatted for readabiliy, you can also put everything on one line and remove the trailing \
from the first line)