How to Create a Folder in the Terminal (mkdir)
You’re about to start your very first project. Exciting, right? But where should it live? If you throw files all over your Desktop, things get messy fast. Before you write a single line of code, you need a clean space to work in.
The good news: making that space takes one short command. In this lesson you’ll learn how to create a folder in the terminal, so every project you build has a tidy home of its own.
To create a folder in the terminal, type mkdir followed by the folder name — for example mkdir my-app — and press Enter. mkdir stands for “make directory,” and a directory is simply another word for a folder.
What does the mkdir command do?
The mkdir command creates a brand-new, empty folder right where you are in the terminal. Think of it like opening a new WhatsApp group: a fresh, empty space made for just one purpose. You give it a name, and only the things that belong to that project go inside.
The word mkdir is short for “make directory.” Here, directory means the same thing as folder — they’re two names for the same idea. So when you create a folder in the terminal, you’re really just making a directory.
How do I create a folder in the terminal?
The pattern is simple: the command, a space, then the name you want. Open your terminal and type this:
mkdir my-app
Press Enter, and that’s it — your new folder is made. Let’s break the line down:
mkdir— the command that means “make a directory.”my-app— the name you’re giving the new folder.
You won’t see a big confirmation message, and that’s normal. In the terminal, no news is good news — if nothing complains, it worked.
How do I check that the folder was created?
To see your new folder appear, list what’s in the current location with the ls command:
ls
There it is — my-app, your folder, made by you. If you’d like a refresher on listing files, see the earlier lesson on checking what’s in a folder. And if folder names with spaces confuse you, that’s why we used a hyphen in my-app instead of “my app” — single-word or hyphenated names are easier to type in the terminal.
Why does keeping each project in its own folder matter?
One project, one folder — everything tidy in one place. A clean folder today saves you hours next week, because tidy projects are easy to find later. When you ask an AI tool like Claude to help build something, it also works far better inside a clear, organised project folder than in a cluttered Desktop.
This small habit pays off all the way through your journey. As you move from these basics toward building real apps and AI agents in the free Zero to AI Hero course, a clean folder structure keeps every project easy to understand — for you and for any AI helping you.
Key takeaways
- To create a folder in the terminal, type
mkdirplus a name, likemkdir my-app, and press Enter. mkdirmeans “make directory,” and a directory is just another word for a folder.- Run
lsafterwards to see your new folder appear in the list. - No confirmation message usually means the command worked.
- Keep one project per folder — it stays tidy and is easier for both you and AI tools to work with.
Next up: creating files inside your shiny new folder.
🚀 Take the full free course: Zero to AI Hero — learn to build with AI from scratch. New lessons daily, in Hindi & English.
Want to actually learn this?
151 free 2-minute lessons — from "what's a file?" to building with AI.
▶ Start the free course