What is the difference between MD and MKDIR?

Both teams create folders. I read that MKDIR can even create subfolders.

  • Is that just the difference?
  • Why do two teams do the same?
  • Which should i use?
+4
source share
2 answers

Just the aliases of the same team. 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.
+11
source

In addition to the @npocmaka answer , I want to provide a list of all such aliases, for reference only:

cd   =  chdir
md   =  mkdir
rd   =  rmdir
ren  =  rename
del  =  erase
+12
source

Source: https://habr.com/ru/post/1605693/


All Articles