How to mass folder named according to some expression
Question
I want to create many folders whose names are like folder_x
where x is an even number less than 256. Is there a unix command/dos command or some shellscript that I can run to do this?
Or may be some free utility program that does mass folder creation?
I want to do this on Windows.
Solution
In bash and other compatible shells:
for i in $(seq 0 2 255) ; do mkdir "folder_$i" ; done
OTHER TIPS
A simple bash script will do that.
for i in {0..256..2}
do
mkdir folder_$i
done
In a Windows cmd
prompt, this would be:
for /L %i in (0,2,255) do mkdir folder_%i
If you want to add this to a .bat file, remember it will need double %
:
for /L %%i in (0,2,255) do mkdir folder_%%i
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow