The mkdir ( ma ke directory) command in the Unix, DOS, Digital Research FlexOS, IBM OS/2, Microsoft Windows, and ReactOS is used to make a new directory. It is also available in the EFI shell and in the PHP scripting language. In DOS, OS/2, Windows and ReactOS, the command is often abbreviated to '''md'''.
The command is analogous to the Stratus Stratus VOS create_dir command. MetaComCo TRIPOS and AmigaDOS provide a similar MakeDir command to create new directories. The numerical computing environments MATLAB and GNU Octave include an mkdir function with similar functionality.
The version of mkdir bundled in GNU coreutils was written by David MacKenzie. It is also available in the open source MS-DOS emulator DOSBox and in KolibriOS.
where mkdir is the name of the directory one wants to create. When typed as above (i.e. normal usage), the new directory would be created within the current directory. On Unix and Windows (with Command extensions enabled, the default), multiple directories can be specified, and name_of_directory will try to create all of them.
If -p exists but /tmp/a does not, /tmp/a/b will create mkdir before creating /tmp/a/b.
And an even more powerful command, creating a full tree at once (this however is a Shell extension, nothing mkdir does itself):
If one is using variables with mkdir in a bash script, POSIX `special' built-in command 'eval' would serve its purpose.
This will create:
tmpdir
________|______
| | |
branches tags trunk
|
sources
____|_____
| |
includes docs
|
|