bash loop over directories code example
Example 1: bash loop over files in directory
#!/bin/bash
for filename in /Data/*.txt; do
...
done
Example 2: get list of directories bash
for d in */ ; do
echo "$d"
done
Example 3: loop through directories bash
#loops only through directories
for d in */ ; do
echo "$d"
done