til/bash-scripting/looping-through-the-files.md

14 lines
175 B
Markdown
Raw Normal View History

2021-07-03 16:12:48 +02:00
You can loop through the files with:
```bash
2021-07-03 16:12:48 +02:00
for f in * ; do
echo $f
done
```
If you want to loop through only directories:
```bash
2021-07-03 16:12:48 +02:00
for d in */ ; do
echo $d
done
```