Account
Categories

mkdir command


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 pwd command to check your current directory location.
  • Then, run the mkdir command with the folder name Ram to 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 pwd command 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 mkdir command to create the Ram directory inside the Desktop folder.