SyntaxFix
Write A Post
Hire A Developer
Questions
Test whether the item is a directory with test -d:
test -d
for i in $(ls); do test -d $i && echo $i ; done