1/9

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 recipes

What happened

  • No output: mkdir worked silently. Run ls and you'll see recipes in the list, between projects and todo.txt.

Common mistakes

  • Making a folder that already exists: mkdir refuses with File exists. Nothing is lost.
  • Using spaces in the name: mkdir my recipes makes two folders, my and recipes.

Tap Run to make a recipes folder, then type ls to see it.

Try it:mkdir recipes
learner@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