【问题标题】:What is the difference between MD and MKDIR batch command?MD 和 MKDIR 批处理命令有什么区别?
【发布时间】:2015-11-28 23:18:23
【问题描述】:

两个命令都创建文件夹。我read MKDIR 甚至可以创建子文件夹。

  • 只有这个区别吗?
  • 为什么有两个命令做同样的事情?
  • 我应该使用哪一个?

【问题讨论】:

  • 两者相同。一(md)是快捷方式。

标签: windows batch-file cmd dos mkdir


【解决方案1】:

只是同一命令的别名。这里是帮助信息:

C:\>md /?
Creates a directory.

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

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.

【讨论】:

    【解决方案2】:

    除了@npocmaka的answer之外,我想提供一个所有此类别名的列表,仅供参考:

    cd   =  chdir
    md   =  mkdir
    rd   =  rmdir
    ren  =  rename
    del  =  erase
    

    【讨论】:

      【解决方案3】:

      在 Linux/Unix/MacOS 上,mkdir 非常相似,但 md 没有任何意义。如果你想要跨平台的东西,你应该使用mkdir

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-03-27
        • 2014-07-26
        • 1970-01-01
        • 2016-06-11
        • 2023-01-26
        • 2012-11-28
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多