Batch create subfolders (terminal)



 

Step 1 : Create list of folder names

TIP: extract folder names from filenames:

 

 

Step 2 : Clean up spacing

Open MS word

Copy folder names to MS word (use paste special > unformatted text)

Remove any hard returns (search and replace paragraph marks ^p with single space)

Edit/Select All

 

Figure : Before and After replacing paragraph marks with single blank space

 

Step 3 : Run commands

In terminal

1) go to source directory where you wish new folders to be added (cd + drag folder )

2) type mkdir command (only once)

3) paste folder names copied from MS Word (Step 2)

4) Press enter

 

 

TIP: as proof of concept recommend first test single command and confirm file has been copied as expected.

 

Step 4 : Verify

run list (ls) command to show folder names

 

Multiple subdirectories

By using -p option can make subdirectories within parent directories

Figure : new subfolder highlighted in blue

 

Figure: copy/paste from MSword (replaced ^t only - ea command appears on a new line)