display folders in a directory using bash script code example Example: get list of directories bash for d in */ ; do echo "$d" done