mkdir Linux Command Cheatsheet




mkdir Linux Command is used to create new directory. Along with Linux systems mkdir is also available in most of the popular operating systems.

Syntax

mkdir [name-of-directory(s)]

Option

OptionDescription
-mSet file mode (as in chmod), not a=rwx - umask
-pMake parent directories as needed
-vVerbose - Print a message for each created directory

Example

mkdir d1 # creates directory with name d1
mkdir d2 d3 d4 # creates directories d2, d3 and d4
mkdir d1/d2/d3 # creates folder d1, then d2 inside d1 and then finally d3 inside d2