The mkdir command in Linux and Unix-like systems stands for “make directory”. It is used to create a new directory.
Here is the basic syntax for the mkdir command:
mkdir [options] directory_name
directory_name is the name of the directory you want to create.
Here are more examples of the mkdir command:
1. To create a new directory called “mydirectory” in the current working directory:
$ mkdir mydirectory
Remember that you can check your current working directory by using the pwd command.
2. to create a new directory called “mail-backup” in the home directory:
$ mkdir ~/mail-backup
Notice the ~/ in front of the mail-backup
3. There is a way to create multiple directories at once:
$ mkdir directory1 directory2 directory3
4. To create a directory and all its parent directories if they do not exist:
$ mkdir -p /full/path/to/new/directory
5. To create a directory with permissions:
$ mkdir -m 777 mydirectory