I want to:
- find all directories that start with a capital letter
- then, find all directories named '.git' in those directories
This is for performance optimization. It's my solution to reduce the search scope to specific directories first, then search inside them.
For the first one, I have this in mind:
find / -mindepth 1 -maxdepth 1 -name "[[:upper:]]*"
And for the second one, I was using:
find / -type d -name ".git" 2>/dev/null
Now I don't know how to chain them together. I want the second
find to only search in the results of the first
Or if it's an X-Y problem, please tell me your suggestions to increase the speed.
I require to find all
.git directories on a machine. But it's guaranteed that
.git directories are all inside top-level directories that start with a capital letter.