mkdir
mkdir (abbreviation of English make directory , create directory ' ; sometimes md ) a command at is Unix-like systems as well as Windows , OS / 2 and DOS and in the scripting language PHP to create new directories to create.
use
mkdir Verzeichnisname
where stands Verzeichnisname
for the directory to be created. If the command is executed in the normal console, the new folder is created starting from the current directory.
parameter
With Unixoid operating systems it has the mkdir
following parameters , among others:
-
-p
: creates the directories if they do not already exist. If the directory already exists, no error is output and the process continues. -
-v
: outputs the created directories on the console, mostly used with-p
. -
-m
: assigns the permissions to the directories that are specified as file permissions after the parameter in the octal value.
-p
is mostly used to build mkdir
more complex file hierarchies, for example through Makefiles.
Examples
An example to -p
is:
mkdir -p /tmp/a/b/c
If /tmp/a
already exists but /tmp/a/b
not, so created mkdir
/tmp/a/b
before /tmp/a/b/c
adding.
It is also possible to create a complete tree:
mkdir -p tmpdir/{trunk/sources/{includes,docs},branches,tags}
If variables are used in a bash script, the 'eval' is required:
DOMAIN_NAME=includes,docs
eval "mkdir -p tmpdir/{trunk/sources/{${DOMAIN_NAME}},branches,tags}"
The following tree is created:
tmpdir
________|______
| | |
branches tags trunk
|
sources
____|_____
| |
includes docs
Web links
- Mkdir Microsoft TechNet