mkdir

本页使用了标题手工转换,涉及首字符小写
本页使用了标题或全文手工转换,现处于中国大陆简体模式
求闻百科,共笔求闻

mkdirmake directory,创建目录)命令UnixDOSOS/2Microsoft Windows操作系统以及PHP脚本语言中用于创建一个目录。DOS、OS/2和Windows中,这条指令常被简写用作md

用法

一般用法如下:

mkdir name_of_directory

name_of_directory是将被创建的目录名。如上所示输入后,会在当前目录下创建新目录。On Unix and Windows (with Command extensions enabled,[1]the default [2]), multiple directories can be specified, and mkdir will try to create all of them.

选项

在类Unix操作系统中,mkdir提供参数。最常用的三个参数为:

  • -p: will also create all directories leading up to the given directory that do not exist already. If the given directory already exists, ignore the error.
  • -v:显示mkdir创建的每个目录。通常与-p配合使用。
  • -m:指定目录的octal permissions

-p is most often used when using mkdir to build up complex directory hierarchies, in case a necessary directory is missing or already there. -m is commonly used to lock down temporary directories used by shell scripts.

参考资料

  1. Microsoft Windows XP - Mkdir. Microsoft. [25 October 2012]. 
  2. Microsoft Windows XP - Cmd. Microsoft. [25 October 2012]. 

外部链接