Cleaning up multiple directories

Is there a way to

task cleanUp{
   delete './*/output'

Which would clean up every directory’s output folder inside each folder?

when i did that i got

Build file 'BBM\SingleBlockMods\build.gradle' line: 43

* What went wrong:
A problem occurred evaluating root project 'SingleBlockMods'.
> Could not normalize path for file 'BBM\SingleBlockMods\.\*\output'.

Never Mind realized Clean runs clean for all submodules