Which command is used in both linux and windows cli to create a new directory?

The files and folders/directories are the main sources of storage in any operating system. Folders are also known as directories, but Windows users are more familiar with the “Folder” name. The folder may store and manage files or subfolders. These folders are created on a system Hard drive. Users may need to create a new folder or directory to manage program or system files in a better way.

In this blog, we will demonstrate various approaches to creating a new folder or directory in Windows. The below listed learning outcomes are expected:

  • Using GUI
  • Using Command Prompt
  • Using Shortcut key
  • Using Windows PowerShell

So, let’s get started!

Method 1: Create Directory or Folder Manually Using GUI

People mostly use and operate Windows operating systems through GUI. To create a new directory or folder in Windows using GUI follow the below-given instruction:

  • First, open the path where you want to create a folder. Let’s say, it is required to create a new folder on the Windows desktop
  • Now, right-click on the desktop, and the Context menu will appear on the screen.
  • Move the pointer to the “New” option and hit the “Folder” option.

Which command is used in both linux and windows cli to create a new directory?

Now you can see that a new folder will appear on the screen. Set the name of the folder and hit the Enter key:

Which command is used in both linux and windows cli to create a new directory?

Here it is! A directory/folder is created on the desktop.

Method 2: Create Directory or Folder Using Windows Command Prompt

Command Prompt is a Windows command line interface or shell where users operate Windows operating systems through commands. Let’s have a look at the below-provided steps to create a new directory or folder using Command Prompt.

Step 1: Open Windows Command Prompt
Search “Command Prompt” in the “Startup” menu and open Command Prompt from the displayed results:

Which command is used in both linux and windows cli to create a new directory?

Step 2: Open the Desired Directory
Open the folder path in which you want to create a new directory. Here, we will create a new directory in the “Documents” folder. The provided command will change the current directory to the “Document”:

> cd C:\Users\anuma\OneDrive\Documents

Which command is used in both linux and windows cli to create a new directory?

Step 3: Create New Folder
For the creation of a new directory, utilize the “mkdir” command. Follow the below-mentioned command to create a new folder named “My_First_Folder”:

Which command is used in both linux and windows cli to create a new directory?

Step 4: Verify the Folder Creation
Let’s verify whether the new folder “My_First_Folder” is created or not. For this purpose, utilize the “dir” command. The dir command is primarily used to list the file and folders of the currently opened directory:

You can see that the “My_First_Folder” folder is present in the current directory which assures the creation of the folder.

Which command is used in both linux and windows cli to create a new directory?

Method 3: Create Directory or Folder Using Shortcut Key

Shortcut keys are the combination of keys to carry out any process instantly. There is some command behind the operation of the shortcut keys. In Windows, we can create a new directory or folder using the “CTRL+SHIFT+N” shortcut key.

First, open the directory, where you wish to create a new directory or folder. As we have opened the “Documents” directory. After that, press the “CTRL+SHIFT+N” combined key from the keyboard to create a new folder or directory. You can see that a new folder appears on the screen, set the folder name and press Enter key:

Which command is used in both linux and windows cli to create a new directory?

From the below output, you can see we have successfully created “My Folder” using the Shortcut key in Windows:

Which command is used in both linux and windows cli to create a new directory?

Method 4: Create Directory or Folder Using Windows PowerShell

We can also create a directory or folder using PowerShell as well. PowerShell is a command line interface/shell of Windows used to automate administrative activities. The below-provided steps will guide you to create a new directory on Windows PowerShell.

Step 1: Open Windows PowerShell
Firstly, launches the Windows PowerShell. To do this, open the “Run” box using the “Windows+R” key then type “powershell” and press the “OK” button:

Which command is used in both linux and windows cli to create a new directory?

Step 2: Create New Directory
Utilize the PowerShell “new-item” cmdlet that is used to add new items such as folders and files in Windows. The “-itemtype” option will specify the item that the “new-item” command will create a directory. The following command will create a directory “Directory1” in “E” drive:

> new-item E:\Directory1 -itemtype directory

Which command is used in both linux and windows cli to create a new directory?

For verification purposes, you can see that we have successfully created a “Directory1” in “E” drive:

Which command is used in both linux and windows cli to create a new directory?

Alternatively, you can also utilize the “md” command (stands for “Make Directory”) to create a new directory or folder. For instance, the following command will create a directory “Directory2” in the “E:\” drive:

Which command is used in both linux and windows cli to create a new directory?

The successful execution of the command shows that the “Directory2” has been created in the “E:\” drive.

You have learned the different methods to create a new folder or directory.

Conclusion

To create a new folder or directory, use the “mkdir” command in CMD or use the “CTRL+SHIFT+N” shortcut or the Windows GUI, or “new-item” and “md” cmdlets in PowerShell. We have demonstrated multiple methods for directory or folder creation in Windows. A terminal enthusiast can use the commands of CMD and PowerShell to create a directory. Whereas a GUI lover can use the shortcut key or right-click anywhere to create a directory or folder. Here, you have learned multiple methods to create a folder in Windows.

About the author

Which command is used in both linux and windows cli to create a new directory?

I am graduated in computer science. I am a junior technical author here and passionate about Programming and learning new technologies. I have worked in JAVA, HTML 5, CSS3, Bootstrap, and PHP.

Which command is used in both Linux and Windows to create a new directory?

The mkdir (make directory) command in the Unix, DOS, DR FlexOS, IBM OS/2, Microsoft Windows, and ReactOS operating systems is used to make a new directory.

Which command is used in both Linux and Windows CLI to create a new directory quizlet?

The mkdir (Make Directory) command is used to create a subdirectory or folder on the file system. The mkdir command is used in both Windows and Linux.

Which command is used to create a new folder in a CLI?

Use the mkdir command to create one or more directories specified by the Directory parameter.

Which of the following Windows CLI commands are used to create a directory?

mkdir (make directory) The mkdir command will create a directory or subdirectory. It creates the directory in the current directory. For example, in the command prompt, my path is c:\it, if I type mkdir folder1 it will create folder1 in the c:\it folder. If I look in windows explorer I'll see the folder1 directory.