mkdir command
Create directories.
- Files & directories
- Package coreutils
- 3 options · 5 examples
Syntax
mkdir [options] directory…Provided by the coreutils package. Run man mkdir for the full manual.
Common options
| Option | What it does |
|---|---|
-p | Create parent directories as needed; no error if it exists |
-m MODE | Set permissions, e.g. -m 755 |
-v | Print each directory created |
Examples
Create a directory
mkdir backupsCreate nested directories
mkdir -p /opt/app/logs/2026Create several at once
mkdir css js imgCreate a tree with brace expansion
mkdir -p project/{src,tests,docs}Create with permissions
mkdir -m 700 ~/.secrets
No example matches. Check the options table or search the guides.
mkdir guides
- mkdir Command in Unix/Linux with Examples Linux Commands · Updated Apr 2025
