18

Both command creates folders. I read that MKDIR can create even subfolders.

  • Is that only difference?
  • Why there are two commands doing the same?
  • Which one should I use?
aschipfl
  • 31,767
  • 12
  • 51
  • 89
Tomas Kubes
  • 21,982
  • 14
  • 105
  • 142

3 Answers3

30

In addition to @npocmaka's answer, I want to provide a list of all such aliases, just for reference:

cd   =  chdir
md   =  mkdir
rd   =  rmdir
ren  =  rename
del  =  erase
Community
  • 1
  • 1
aschipfl
  • 31,767
  • 12
  • 51
  • 89
27

Just aliases of the same command.Here are the help messages:

C:\>md /?
Creates a directory.

MKDIR [drive:]path
MD [drive:]path

and

C:\>mkdir /?
Creates a directory.

MKDIR [drive:]path
MD [drive:]path

If Command Extensions are enabled MKDIR changes as follows:

MKDIR creates any intermediate directories in the path, if needed.
For example, assume \a does not exist then:

    mkdir \a\b\c\d

is the same as:

    mkdir \a
    chdir \a
    mkdir b
    chdir b
    mkdir c
    chdir c
    mkdir d

which is what you would have to type if extensions were disabled.
npocmaka
  • 53,069
  • 18
  • 138
  • 177
0

On Linux/Unix/MacOS, mkdir is very similar, but md means nothing. If you want something cross-platform, you should use mkdir.

Jake
  • 793
  • 7
  • 16