Creating multiple subdirectories on terminal

I’m studying terminal commands, today i’m trying to create a new directory with multiple subdirectories on terminal - using mkdir -p ::

Supposing i’m at /home/luigi/Desktop/dir1

Trying to execute::
luigi@manjaro-linux: mkdir -p dir2 / {dir3, dir4, dir5}
Result
zsh: parse error near `}’**

Ending bracket turns red. Glad for help!

I found the reason for the problem. I put space between dir2 / {dir3, dir4, dir5}. I removed them and now it worked.

1 Like

I know it can be kind of a tough read at first, but it can be very rewarding if the Bash Reference is read to understand how the command line is parsed, the use of single and double quotes and $IFS. I’m sure zsh has something similar.

There’s a very good article, “Filenames and Pathnames in Shell: How to do it Correctly”.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.