Code / Command Line & Git / Unit 2: Making & changing files

Make folders and files फ़ोल्डर और फ़ाइलें बनाएँ

Lesson 3 of 12 · about 12 minutes · mkdir, mkdir -p, touch and tree.

⚡ 0 XP

Step 1 of 2

mkdir and touch

~$ mkdir shop~$ cd shop~/shop$ ls

mkdir name makes a new folder (make directory). touch name.txt makes a new, empty file. You can give several names at once: touch menu.txt prices.txt.

Tip: avoid spaces in names. Use chai-stall or chai_stall, not chai stall — a space splits it into two names!

Example
mkdir tiffin
cd tiffin
touch monday.txt tuesday.txt
ls

🎯 Challenge: Open your chai stall +10 XP

Make a folder chai-stall in your home, go into it, and create two empty files: menu.txt and prices.txt. End inside ~/chai-stall.

Try twice to unlock the solution (0/2)

terminalCtrl ⏎

A safe practice terminal. Type a command and press Enter. Type help to list commands. Tab completes names, ↑ recalls the last command.

Files · ~ = /home/asha

Your home folder is empty.

Git timeline

No git repository yet. Start with git init.

Checklist

Press Run to check your code.

  • ~/chai-stall exists
  • menu.txt exists
  • prices.txt exists
  • You are inside ~/chai-stall
Lesson notes (text version)

1. mkdir and touch

mkdir name makes a new folder (make directory). touch name.txt makes a new, empty file. You can give several names at once: touch menu.txt prices.txt.

Tip: avoid spaces in names. Use chai-stall or chai_stall, not chai stall — a space splits it into two names!

                mkdir tiffin
cd tiffin
touch monday.txt tuesday.txt
ls
              

Challenge: Open your chai stall

Make a folder chai-stall in your home, go into it, and create two empty files: menu.txt and prices.txt. End inside ~/chai-stall.

2. mkdir -p and tree

Need folders inside folders inside folders? Plain mkdir photos/2026/diwali fails if photos does not exist yet. The flag -p (parents) makes every missing folder on the way: mkdir -p photos/2026/diwali.

tree draws your folders as a neat picture, so you can check what you built.

                mkdir -p notes/class10/science
tree
              

Challenge: A home for Diwali photos

Inside the existing chai-stall folder, create photos/2026/diwali with a single mkdir -p command (so the full path is ~/chai-stall/photos/2026/diwali). Then run tree to see the result.

Search by task, format or tool name.