I have a folder with some directories and some files.
for d in *; do
echo $d
done
will loop through all files, but I want to loop only through directories. How do I do that?
You can test with
This is one of the file test operators. |
|||||
|
You can use pure bash for that, but it's better to use find:
(find additionally will include hidden directories) |
|||||
|