Definition:
When you need to make a directory to store a file or directory, you use this command.
It also makes the directory in the recursive path for other directories.
Syntax:
$ mkdir
Example 1:
Command:
$ pwd $ mkdir Ram
Output:
/project Ram
Explanation:
- Use the
pwdcommand to check your current directory location. - Then, run the
mkdircommand with the folder nameRamto create a new directory inside the Project folder.
Example 2 (recursive):
Command:
$ pwd $ mkdir /home/user/Desktop/Ram
Output:
/home/user/project Ram
Explanation:
- Use the
pwdcommand to check your current directory location. - Once you know the path, provide the full location where you want to create the new directory.
- Finally, run the
mkdircommand to create the Ram directory inside the Desktop folder.
