#!/bin/bash DOC_ROOT='/path/to/somewhere' for file in `ls $DOC_ROOT`; do if [ -d $file ] then echo $file fi done;