Creating multiple nested directories with one command
mkdir
accepts multiple path arguments:
mkdir -p -- a/foo b/bar a/baz
To add to the above answers you can also do (in csh
, tcsh
, ksh
, bash
, zsh
, fish
, yash -o brace-expand
):
mkdir -p /path/{to,a}/{lot,of}/directories
Reading the man page is always a good place to start.
The -p
flag will create the required intermediate directories on the path.