Ubuntu – Creating a new subdirectory in multiple existing directories


I am trying to figure out an elegant way to create a new subdirectory in a series of existing directories.

I have 15 already created directories called Week1 through Week15. Within those directories, I'd like to create a new directory called "Assignments." I'm thinking this might require a loop of some kind, but outside of that I'm a little lost.

I know I can "cd" into each directory and then "mkdir Assignment" and repeat this step for all 15 directories, but I know there must be an easier way.

Any help/advice will be greatly appreciated!

Best Answer

You can do it without a loop:

mkdir -p Week{1..15}/Assignments