How To Perform a For Loop From the Command Line

Iterate over a range of numbers and files

Matt Croak Code
Better Programming
Published in
4 min readMar 31, 2022

--

Photo by Goran Ivos on Unsplash

In my last post, I covered how to open a browser tab from the command line on a Mac. Now, what if you wanted to do this five times? Or 10? In this post, I’ll quickly show you how to perform a for loop in your terminal that achieves this iterative behavior.

for…in 1 2 3 4 5

--

--