for dir in $(find /rootdir/101/ -type d -name "B??"); do find $dir -type f -exec rm '{}' \; ; done; # or to move elsewhere # do find $dir -type f -exec mv '{}' /tmp/foundstuff/ \; ;