I want to find the path for directory name bbb
where the parent directory called aaa
For example
/aaa/bbb
/tmp/aaa/bbb
/usr/bin/aaa/bbb
/home/aaa/bbb
/home/aaa/xxx/bbb
So i wrote something like this:
find /*/aaa -name bbb
In some platforms it works and in some it doesn't, and in any case the /aaa/bbb
is not found because there is no parent directory to aaa
I guess I could run find / -name bbb | grep \/aaa
but I think if there is something smarter..?
locate
command implemented which nightly keeps a database of all filenames. you can then justlocate aaa/bbb
.