for Command Examples

Perform a command several times. More information: https://www.gnu.org/software/bash/manual/bash.html#Looping-Constructs.

for {{variable}} in {{item1 item2 ...}}; do {{echo "Loop is executed"}}; done

for {{variable}} in {{{from}}..{{to}}..{{step}}}; do {{echo "Loop is executed"}}; done

for {{variable}} in {{path/to/file1 path/to/file2 ...}}; do {{echo "Loop is executed"}}; done

for {{variable}} in {{path/to/directory1/ path/to/directory2/ ...}}; do {{echo "Loop is executed"}}; done

for {{variable}} in */; do (cd "${{variable}}" || continue; {{echo "Loop is executed"}}) done