How do I make multiple folders in a single location using relative path to the location? How do I make multiple folders in a single location using relative path to the location? shell shell

How do I make multiple folders in a single location using relative path to the location?


In Bash and other shells that support it, you can do

mkdir ~/Labs/lab4a/folder{1..3}

or

mkdir ~/Labs/lab4a/folder{1,2,3}

Other options:

mkdir $(seq -f "$HOME/Labs/lab4a/folder%03g" 3)mkdir $(printf "$HOME/Labs/lab4a/folder%03g " {0..3})

Which will give you leading zeros which make sorting easier.

This will do the same thing in Bash 4:

mkdir ~/Labs/lab4a/folder{001..3}


Use shell expansion :

mkdir Labs/lab4a/{folder1,myfolder,foofolder}

That such an underestimated possibility :)

my2c


Go to console -

cd ...

mkdir {8...30}

Create multiple folders linux