← All sections

Section 0

Before you start

The handful of basics every other section quietly assumes you already know. Nobody is born knowing these. Twenty minutes here saves you being lost later.

One promise first

You are about to open a window that looks like something from a film about hackers. It is black, it has no buttons, and it is genuinely intimidating the first time.

So, a promise:

You cannot break your computer by typing in it Not by accident. Almost everything you'll type just looks at things — shows you a list, prints where you are. The small number of commands that can actually destroy something are named in these pages with big warnings around them. Everything else is safe to try.

If you're ever unsure about a command, paste it to your AI and ask "what does this do, and can it delete anything?" before pressing Enter. That's not a beginner's crutch — professionals do exactly this.

Opening the Terminal

The Terminal is a window where you type instructions instead of clicking them. That's the entire idea.

You already know how to tell a computer to do things by clicking — double-click a folder, drag a file to the bin. The Terminal is the same actions, typed. Typing is uglier but it's precise, it's much faster once you know it, and — importantly for you — it's something you can paste to an AI and something an AI can hand back to you. You can't paste a mouse click.

  1. Hold down the Cmd key and tap the spacebar.
    A small search box appears in the middle of your screen. This is Spotlight — the Mac's way of finding anything.
  2. Type the word terminal.
    You'll see results appear as you type. Don't worry about typing all of it.
  3. Press Enter.
    A window opens. It's mostly empty, with a line of text at the top and a blinking cursor.
What you should see yashina@Yashinas-MacBook-Air ~ %

Yours will have your own name in it. That blinking block after the % is where what you type will appear.

That line is called the prompt. It's the computer saying "I'm ready, what would you like?" — it just says it in a very terse way.

On Windows Press the Windows key, type powershell, press Enter. Same idea, slightly different words on screen. Everything in these pages works in both unless it says otherwise.

Running your first command

"Running a command" sounds technical. It means: type some words, press Enter, read what comes back. That's all it has ever meant.

Try it. Type this exactly, then press Enter:

whoami
What you should see yashina

Your computer's username. Then a fresh prompt underneath, waiting for the next thing.

You just ran a command. That's the skill. Everything else in these pages is the same move with longer words.

Try one more:

date
What you should see Sun Sep 21 14:32:07 PDT 2026

Neither of those changed anything. They asked a question and got an answer. A surprising amount of what you'll do is exactly this.

Running a command from this website

Every dark box on these pages has a Copy button in its top-right corner. You don't need to retype any of it — and you shouldn't, because one wrong character means it won't work.

  1. Click the Copy button on the dark box.
    It changes to a green "Copied" for a second so you know it worked.
  2. Click once inside your Terminal window.
    This tells your computer that's where you want to type. Without this, the paste goes nowhere.
  3. Press Cmd and V together to paste it. (On Windows: Ctrl and V.)
    The text appears after the prompt.
  4. Read it before you press Enter.
    Every single time. Not because anything here is dangerous, but because it's a habit that will protect you one day when you're pasting something from somewhere less careful.
  5. Press Enter.
The one rule about pasting Never paste a command you found on the internet into your Terminal without knowing what it does. Not from a forum, not from a video description, not from a stranger helping you. Paste it to your AI first and ask what it does. This is how people lose their files — not through hacking, just through trusting a command that looked helpful.

How to tell if it worked

The Terminal is famously bad at celebrating. Here's how to read it.

It worked

Usually you get either the thing you asked for, or nothing at all, and then a fresh prompt.

Worked — it answered yashina@Yashinas-MacBook-Air ~ % whoami yashina yashina@Yashinas-MacBook-Air ~ %
Also worked — silence is good news yashina@Yashinas-MacBook-Air ~ % mkdir my-first-website yashina@Yashinas-MacBook-Air ~ %

Nothing was said, and that's the point. Most commands that do something say nothing when they succeed. Silence means "fine, done." You'll get used to it.

It didn't work

You get a line of text that's clearly complaining.

Didn't work yashina@Yashinas-MacBook-Air ~ % whoamii zsh: command not found: whoamii

Read it slowly: command not found. It doesn't know the word whoamii — because of that extra i. Typo. Retype it and move on.

The three complaints you'll see most command not found — you mistyped it, or the program isn't installed yet.
no such file or directory — it can't find what you named. Usually you're in the wrong folder, or the name is spelled differently.
permission denied — you're not allowed to touch that. Stop and ask rather than forcing it.

Error messages look hostile but they're trying to help. The last line is nearly always the useful one.

Folders, and knowing where you are

This is the concept that trips up almost everyone at the start, so it's worth slowing down for.

When you use Finder, you can see which folder you're looking at. In the Terminal you're also always inside one particular folder — you just can't see it. Commands happen in that folder. Ask to list the files and you get that folder's files, not your whole computer's.

Three commands manage this entirely.

Where am I?

pwd
What you should see /Users/yashina

That's your home folder. Read it right to left: a folder called yashina, inside a folder called Users, at the very top of the drive. Those slashes are just the separators between folder names — like the arrows in Finder's path bar.

What's in here?

ls
What you should see Desktop Documents Downloads Movies Music Pictures

The same folders you'd see in Finder. Because it is the same thing — a different window onto the identical files. ls is short for "list".

Go into a folder

cd Desktop

cd means "change directory", and "directory" is just an older word for folder. You'll see both words used for the same thing forever.

What you should see yashina@Yashinas-MacBook-Air Desktop %

Look at the prompt — it changed from ~ to Desktop. It tells you where you are, if you know to look. That ~ symbol is shorthand for your home folder.

To go back up one level:

cd ..

Two dots means "the folder containing this one". Like the back arrow in Finder.

When something isn't found, check where you are first Nine times out of ten, no such file or directory doesn't mean the file is gone. It means you're standing somewhere else. Run pwd and ls to get your bearings before assuming anything is broken.

The shortcut worth knowing on day one

Typing folder names is tedious and easy to get wrong. So don't.

Type cd — with a space after it — then drag a folder from Finder into the Terminal window and let go. The full path types itself. Press Enter.

This one trick removes most early frustration.

Files, and why the ending matters

You know what a file is. The part worth spelling out is the ending.

EndingWhat it holds
.htmlA web page
.cssHow a web page looks — colors, spacing, fonts
.jsThings a web page does when you click
.mdPlain writing with simple formatting. Your README and AGENTS.md.
.dbA database
.png .jpgPictures

The ending isn't decoration — it's how your computer decides what a file is. Rename notes.txt to notes.html and your browser will now try to open it as a web page.

One special name: index.html When a browser arrives at a folder, it looks for a file called index.html and shows that. It's the "front page" of any folder. That's why every web project has one, and why the pages on this site live in folders each containing an index.html.

Mac hides file endings by default

Which causes real confusion, because you'll swear you named something correctly. Turn endings on once and never think about it again:

  1. Open Finder.
  2. In the menu bar at the top: Finder → Settings.
  3. Click the Advanced tab.
  4. Tick "Show all filename extensions".

Now you can see what your files actually are.

When you get stuck

You will get stuck. Everyone does, permanently, forever — the difference between a beginner and an expert is mostly how quickly they get unstuck.

Here's the method:

  1. Read the last line of the error.
    Not the whole wall of text. The last line is almost always the real complaint.
  2. Copy the whole thing anyway.
    Select it with your mouse, Cmd+C.
  3. Paste it to your AI with context.
    Not just the error. Tell it what you were trying to do:
    I was trying to <what you wanted>.
    I ran this command:
    
    <the command>
    
    And got this:
    
    <the whole error>
    
    What went wrong, and what should I do?
  4. Ask why, once it's fixed.
    "Why did that happen?" The difference between fixing it and not hitting it again.
Say when you don't understand the answer If your AI explains something and it means nothing to you, say so: "explain that like I've never used a terminal before." It will, cheerfully, as many times as you need. Nodding along at an explanation you didn't follow is the only way to actually get stuck.

Things to try

Ten minutes. Nothing here can break anything.

  1. Open the Terminal and run whoami, then date, then pwd. Three commands, three answers. You've now used a terminal.
  2. Run ls, then cd Desktop, then ls again. Watch the answer change. You moved.
  3. Make a folder: mkdir my-first-website. Nothing will be said. Run ls to see it appeared — then look at your actual Desktop and watch it be there too. Same computer, two windows onto it.
  4. Make a typo on purpose. Type lss and press Enter. Read the complaint. Errors are just sentences.
  5. Try the drag trick. Type cd with a space, drag any folder from Finder into the window, press Enter. Then pwd to confirm you're there.

That's the foundation. Section 1 will make a good deal more sense now.