I use bash through Cygwin. I have a large folder (a) with many subfolders (b). These subfolders have one or two subfolders each (s). I want to find all subfolders (b) that have two subfolders (c) and display them.
The structure is as follows:
a b1 c1 b2 c1 c2 b3 c1 c2
So far, I only know how to use find and pipe to list all subfolders in the main folder (a).
find . -type d > folders.txt
How can I output only all b folders with two folders c to a text file with one folder per line? (In my example, the output should be:
b2 b3
source share