Linux mkdir | Linux Create Directory

The Linux mkdir command is very much similar to Windows’s "new folder" feature. This command is used in Linux os to create new directories. The command mkdir stands for "make directory," the below screenshot shows the command’s use case. We created a directory named "dir1" at the home directory of the user. The ls command shows that initially, the directory was not present, and the highlighted box shows the presence of the directory after the command completion.

Linux Mkdir

The syntax of the command is mkdir <directory name>. There are some other variations in the command that will be discussed later in the tutorial.

If the directory is already present, then the command will show you an error explaining the existence of the directory.

Linux Mkdir

If you require to create multiple directories, you can create them with the help of mkdir. The syntax will be mkdir dir1 dir2 dir3,the name of the directories should be passed as arguments to the command with a space in them. The below screenshot shows the same use case.

Linux Mkdir