Create a Directory in Bash

This lesson will enable you to create directories through command line interface.

mkdir

Definition:

mkdir is one of the most important directory manipulation commands. It’s short for ‘make directory’ and as the name suggests, it is used for creating new directories within the current directory. You can create any number of directories with this command. It takes the directory name as an argument.

Syntax:

mkdir [options][dir_name]

Options:

mkdir in terminal can take two options:

Option Meaning
-p Means Parent or Path. It is used when we want to create a directory within a directory that doesn’t already exist
-m Means Mode. It is used to specify and control permission modes

Example:

mkdir my_dir_1 my_dir_2 my_dir_3

Get hands-on with 1200+ tech skills courses.