The mkdir CMD command is a command-line utility used to create directories in the Windows operating system. It is part of the Windows Command Prompt, which is a command-line interpreter that allows users to interact with the operating system. The mkdir command is used to create a new directory, or folder, in the current directory. The mkdir command can also be used to create multiple directories at once.

Purpose of the mkdir CMD Command

The purpose of the mkdir CMD command is to create a new directory in the current directory. This command is useful for organizing files and folders on the computer. It is also used to create multiple directories at once, which can be useful for creating a directory structure.

Syntax of the mkdir CMD Command

The syntax of the mkdir CMD command is as follows:

mkdir [directory]

The directory argument is the name of the directory to be created. If the directory argument is not specified, the command will create a new directory with the same name as the current directory.

Options of the mkdir CMD Command

The mkdir CMD command has several options that can be used to modify the behavior of the command. These options are as follows:

Option Description
-p This option creates the parent directories of the specified directory if they do not already exist.
-v This option displays a message for each directory that is created.
-m This option sets the permissions of the created directory to the specified mode.

User Examples of the mkdir CMD Command

The following are some examples of how the mkdir CMD command can be used:

  • To create a new directory called “example” in the current directory:
    • Open the Command Prompt.
    • Type mkDIR example and press Enter.
  • To create a new directory called “example” in the parent directory:
    • Open the Command Prompt.
    • Type MKDIR ../example and press Enter.
  • To create a new directory called “example” and its parent directories:
    • Open the Command Prompt.
    • Type MKDIR -p example/test/data and press Enter.
  • To create a new directory called “example” and set its permissions to “read-only”:
    • Open the Command Prompt.
    • Type MKDIR -m 0400 example and press Enter.

Conclusion

The mkdir CMD command is a useful command-line utility for creating directories in the Windows operating system. It is used to create a new directory in the current directory, as well as to create multiple directories at once. The command has several options that can be used to modify its behavior, such as the -p option for creating parent directories and the -m option for setting permissions. With the examples provided, users should have a better understanding of how to use the mkdir CMD command.

Leave a Reply