Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between MD and MKDIR batch command?

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?
like image 282
Tomas Kubes Avatar asked Sep 03 '15 08:09

Tomas Kubes


People also ask

What does md mean in batch file?

Make Directory - Create a new folder/directory. Syntax MD [drive:]path [[drive:]path...] Key path The path/directory to create. The path can consist of any valid characters up to the maximum path length.

What is mkdir in batch?

Creates a directory or subdirectory. Command extensions, which are enabled by default, allow you to use a single mkdir command to create intermediate directories in a specified path. This command is the same as the md command.

What is a md command?

Short for "make directory," md is a command used in the MS-DOS and Windows command line.

What is the mkdir command used for?

The mkdir command in Linux/Unix allows users to create or make new directories. mkdir stands for “make directory.” With mkdir , you can also set permissions, create multiple directories (folders) at once, and much more.


2 Answers

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
like image 117
aschipfl Avatar answered Sep 20 '22 06:09

aschipfl


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.
like image 27
npocmaka Avatar answered Sep 22 '22 06:09

npocmaka