Files & folders · Make folders and files
Make a folder: mkdir
mkdir (make directory) creates a new, empty folder.
Why: to organise files, or to start a project.
How to type it: mkdir name. You can give several names to make several folders at once: mkdir a b.
Worked example
learner@shellstreak:~$ mkdir recipesWhat happened
- No output:
mkdirworked silently. Runlsand you'll seerecipesin the list, betweenprojectsandtodo.txt.
Common mistakes
- Making a folder that already exists:
mkdirrefuses with File exists. Nothing is lost. - Using spaces in the name:
mkdir my recipesmakes two folders,myandrecipes.
Tap Run to make a recipes folder, then type ls to see it.
Try it:
mkdir recipeslearner@shellstreak: ~
Starting your practice shell…
You can also type in the terminal yourself. Try anything: you can't break it.
Go deeper: Basic terminal commands for beginners