How to Make Directories with mkdir Command and Set Permissions on Linux

Directories are used to store other directories or files in Linux. We can use the mkdir command to make a directory.

How to Make Directory with mkdir Command

We can use the mkdir command to make a directory. The directory name is given to the commanddir as a parameter.

$mkdir database How to Make Multiple Directories We can make multiple directories using the mkdir command. Every directory name is provided as a parameter. The directory names are separated by spaces. $ mkdir database users backups

If the directory names contain spaces double quotes .

How to Make a Directory and Set Permissions

The -m option is used to specify permissions.

\$ mkdir -m 722 backup