script bash get all folders code example
Example 1: get list of directories bash
for d in */ ; do
echo "$d"
done
Example 2: loop through directories bash
#loops only through directories
for d in */ ; do
echo "$d"
done
for d in */ ; do
echo "$d"
done
#loops only through directories
for d in */ ; do
echo "$d"
done