list all the directories in linux code example
Example 1: get list of directories bash
for d in */ ; do
echo "$d"
done
Example 2: list all files in a directory and subdirectory linux
find . -type f -follow -print
for d in */ ; do
echo "$d"
done
find . -type f -follow -print