java-tutorials/linux-bash-modules/linux-bash-loops/src/main/bash/loop_directories.sh

11 lines
131 B
Bash
Raw Normal View History

#!/bin/bash
for dir in */; do
echo "$dir"
done
for file in *; do
if [ -d "$file" ]; then
echo "$file"
fi
done