Thanks! On Wed, Feb 24, 2016 at 5:32 PM, Matthew Webster < [log in to unmask]> wrote: > Hi, > If you just want to get a list of all the sub-folders matching some > mask then something like: > > for thing in folder*/subFolder*; do echo $thing; done > > should do what you want. > > Kind Regards > Matthew > > > I'm running fsl command on several folders using loop option as follow: > > > > for dir in Study* ; do > > fslmaths ${dir}/img1.nii -add ${dir}/img2.nii ${dir}/out.nii > > done > > > > How can I run the loop on 2 hierarchy? > > i.e. all Study_XX folders within Sub_XX folders? > > > > Many thanks > > Moran >