Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Teachable.

Create a folder – Terminal

Summary

To create a folder using your terminal, enter the following command:

mkdir folder-name

Details

To create a folder named new-project, enter the following command in your terminal:

mkdir new-project

To check that the folder was created, enter the following command to print out the contents of your current folder:

ls

You should see the new-project folder listed in the output along with any other files and folders inside the current directory.

Create multiple folders

To create multiple folders, pass in multiple folder names as arguments to the mkdir command, like this:

mkdir folder-1 folder-2

The above command will create directories named folder-1 and folder-2.

Options

You can use the -p flag with the mkdir command to create intermediate folders. The folder names will be separated with a slash. For example, if you want to create folder-1 and then create folder-2 inside of it, you can use the following command:

mkdir -p folder-1/folder-2

Exercises

Try the following command in your project folder:

mkdir css

References

Command Line Primer on the Apple Developer Archive (see the sections called Specifying Files and Directories and Frequently Used Commands)

Back to: Terminal Reference > Terminal Basic Commands