freeCodeCamp/guide/english/bash/bash-mkdir/index.md

23 lines
594 B
Markdown
Raw Normal View History

---
title: Bash mkdir
---
## Bash command: mkdir
2018-10-16 11:30:13 +00:00
**Creates a directory**
2018-10-16 11:30:13 +00:00
```
mkdir directory_name
```
2018-10-16 11:30:13 +00:00
Make directory(ies) with the provided name if they do not already exist.
Commonly used options:
- `-p` no error if existing, make parent directories as needed.
- `-v` prints message for each created directory.
Let's say we need to create a directory `dir` in the path `a/b/c/dir`, but directory `b` and `c` don't exist. In this case, `mkdir -p a/b/c/dir` will create the missing directories in the path.
### More Information:
2018-10-16 11:30:13 +00:00
* [Wikipedia - Mkdir](https://en.wikipedia.org/wiki/Mkdir)