utility
mkdir — create a directory
External utility, not Bash syntax. Creates directories; the selected GNU implementation also supports -p to create missing parents and tolerate existing directories. For beginner labs use a new directory name; avoid confusing an existing directory with a newly created one. Example prerequisite: use a new unused directory name in a writable practice folder.
Formal Syntax & Structure
bash syntaxbash
mkdir [OPTION]... DIRECTORY...Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| DIRECTORY | path | Name of a directory to create. |
| -p | option | Create missing parent directories; tolerate existing directories. |
Return Value
exit status
0 on success; nonzero if directory creation fails.
Working Example
Example Snippetbash
mkdir bytemind-bash-lab