Make a folder
Create directories with mkdir
⏱ Est. ~7 min
01 · Read
So far you've explored existing folders. Now it's time to make your own. The mkdir command creates a new empty folder.
💡 Picture thisIf the file system is a building, mkdir is adding a new room. You pick the name and the new room is ready for you to fill.
Key points
- mkdir is short for make directory
- Type mkdir followed by the folder name you want
- The new folder starts out empty
- Use mkdir -p path/to/nested/folder to create multiple levels at once (-p flag means "create parents too").
02 · Terminal exercise
Let's build something. First, a folder to hold the project.
(This section is interactive — please enable JavaScript.)
03 · Terminal exercise
Nice! Confirm it's really there.
(This section is interactive — please enable JavaScript.)
04 · Fill in the blank
mkdir is short for "make ___".
05 · Terminal exercise
Now step into your new folder.
(This section is interactive — please enable JavaScript.)
06 · Terminal exercise
Inside, make a folder for CSS files.
(This section is interactive — please enable JavaScript.)
07 · Terminal exercise
Make another for JavaScript files. Call it js.
(This section is interactive — please enable JavaScript.)
08 · Terminal exercise
Now try the -p flag — it lets you create multiple nested folders at once.
(This section is interactive — please enable JavaScript.)
09 · Fill in the blank
To create an empty folder called assets, you'd type: ___ assets
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.