bash script to get all folders in current directory code example Example: get list of directories bash for d in */ ; do echo "$d" done