Create Multiple Directories in Linux Command Line using Patterns and Range

If you want to create multiple directories in a folder, you can do that using the mkdir command.

Let’s say we want to create directories like:

In this case, we have a pattern. So, we will give that pattern to mkdir.

mkdir ItsFOSS-{Debian,Ubuntu,Fedora,Arch,Manjaro}-{Sample,Test,Work}

The output will be:

Here, we have given an array of items. The same works, if we are giving a range of numbers or alphabets.

Let’s create a directory structure to organize your photo collection from 2018 to this year, with one folder for each month.

mkdir {2018-2024}-{01-12}

The range can also be {A…Z}, {Z…A}, etc.