How to Create a Directory or Folder (2024)

Updated: 02/04/2024 by Computer Hope

How to Create a Directory or Folder (1)

There are multiple ways to create or add a folder, subfolder, directory, and subdirectory on a computer. The methods for doing so depend on the operating system or where the directory is being created. Select a link below for steps on creating a directory or folder in each major operating system.

  • Creating a folder in Microsoft Windows.
  • Creating a directory in MS-DOS and Windows Command Prompt.
  • Create a directory with a batch file.
  • Creating a directory in Linux and Unix.
  • Creating a directory in Microsoft Windows 3.x.
  • Creating a folder in macOS.

Creating a folder in Microsoft Windows

There are a few ways to create a folder in Microsoft Windows, generally depending on where you want the new folder to be placed. To proceed, select a method from the list below or check out each section individually.

  • My Computer or Windows Explorer
  • Windows desktop
  • Create a new folder using a keyboard shortcut
  • Windows command line

My Computer or Windows Explorer

  1. Press the Windows key+E to open Windows Explorer.
  2. On the left side of the window, select the drive or folder where you want to create the new folder; for example, the C: drive. Or, you can create a folder in the root directory.

How to Create a Directory or Folder (2)

  1. In Windows 11, click the New option in the menu bar and select Folder in the drop-down menu.

    In Windows 8 and 10, on the Home tab, click the New folder icon.

    In Windows 7 and earlier, in the file menu bar, click File and select Folder in the drop-down menu.

Tip

In all versions of Windows, you can also right-click on a blank portion of the folder, select New, and then Folder from the drop-down menu.

How to Create a Directory or Folder (3)

Windows desktop

  1. Navigate to the Windows desktop. You can quickly do this with the keyboard shortcut Windows key+D.
  2. Right-click any blank portion of the desktop.
  3. In the menu (like that shown in the picture), click New and then Folder.
  4. Once the new folder appears, type a name for it and press Enter.

Create a new folder using a keyboard shortcut

While in Windows Explorer, press Ctrl+Shift+N to create a new folder without using the mouse.

Windows command line

See the following MS-DOS and Windows command line user section to create a directory in the Windows command line.

Creating a directory in MS-DOS and Windows Command Prompt

Tip

It is more appropriate to use the term "directory" instead of "folder" when referring to the command line.

To create a directory in MS-DOS or the Windows Command Prompt (cmd), use the md or mkdir MS-DOS command. For example, below, we are creating a new directory called "hope" in the current directory.

mkdir hope

You can also create multiple new directories in the current one with the md command. In the following example, we are creating three new directories, called "user1," "user2," and "user3," in the current directory.

md user1 user2 user3

To create a directory with spaces, you must surround the directory name with quotes. In the example below, we create a "my example directory" in the current directory.

md "my example directory"

To create a directory in the parent directory without first moving to that directory, you can use the command below. The example below moves back one directory to create the "example" directory.

md ..\example

To create a subdirectory in a different directory without moving to it, use a command similar to the example below. This command creates a "test" directory in the hope directory.

mkdir hope\test

Tip

Once a directory is created, you can use the cd command to change and move to that directory.

To make a directory in another drive without moving to that drive, use a similar command to the example below. The following command creates an "example" directory on the F: drive. (The drive letter "f" should be substituted for the actual drive letter of the disk where you're creating the folder: "c", "d", etc.)

md f:\example
  • How to use the Windows command line (DOS).
  • How to get to an MS-DOS prompt or Windows command line.

Create a directory with a batch file

A batch file consists of one or more commands that are entered into the command line. Therefore, you can use any examples from the section above in a batch file to create a new folder.

Creating a directory in Linux, Unix, and their variants

Tip

It's traditional to call it a "directory" instead of "folder" in the command line, but both terms refer to the same thing.

Note

You must have administrator permissions to create a new directory outside your home directory and its subdirectories.

To create a directory in Linux, Unix, or any variant, use the mkdir command. For example, below, we are creating a new directory called "hope" in the current directory.

mkdir hope

Tip

To explicitly specify that the new directory should be located in the current directory, you can prefix its name with a dot-slash ("./"):

mkdir ./hope

To create a directory whose parent directories do not yet exist (creating the parent directories in the process), use the -p option with mkdir:

mkdir -p hope/files/documents

Tip

Once the new directory is created, you can use the cd command to change and move to that directory. To remove the directory (if it is empty), use the rmdir command. To change the permissions of a directory after it is created, use the chmod command.

  • Linux and Unix shell tutorial

Creating a folder and directory in Microsoft Windows 3.X

File Manager

  1. Open File Manager
  2. Open the folder where you want to place the new folder, and on the top menu of File Manager, select File and then new folder.

MS-DOS

See the MS-DOS user section above for information about creating a directory in MS-DOS.

Creating a folder in macOS

Desktop folder

  1. Navigate to the macOS desktop.
  2. Right-click (tap two fingers on the trackpad or multi-touch mouse) any blank space on the desktop.
  3. Select New Folder from the drop-down menu.

How to Create a Directory or Folder (4)

  1. Type a name for the folder and press Return.

Create a folder in a directory

  1. Open Finder and navigate to the directory where you want to create the folder.

How to Create a Directory or Folder (5)

  1. Click File in the upper-left corner of the screen.

How to Create a Directory or Folder (6)

  1. Select New Folder in the drop-down menu.

How to Create a Directory or Folder (7)

  1. Type a name for the folder and press Return.

Tip

Users may also press the keyboard shortcut Command+Shift+N to create a new folder.

Tip

To create a directory in the Terminal command line, see the Linux steps.

  • How to delete a file, directory, or folder.
  • How to change or rename a file, folder, or directory.
  • How to delete a file, directory, or folder.
  • How to change the icon of a folder in Windows.
  • How to organize and arrange computer files.
  • How to create a computer file.
  • See the directory and folder definitions for further information and related links.
  • Computer directory and folder help and support.
How to Create a Directory or Folder (2024)
Top Articles
Latest Posts
Article information

Author: Carmelo Roob

Last Updated:

Views: 5960

Rating: 4.4 / 5 (45 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Carmelo Roob

Birthday: 1995-01-09

Address: Apt. 915 481 Sipes Cliff, New Gonzalobury, CO 80176

Phone: +6773780339780

Job: Sales Executive

Hobby: Gaming, Jogging, Rugby, Video gaming, Handball, Ice skating, Web surfing

Introduction: My name is Carmelo Roob, I am a modern, handsome, delightful, comfortable, attractive, vast, good person who loves writing and wants to share my knowledge and understanding with you.