The Terminal: Your 10 Essential Commands
What Is The Terminal?
The terminal (also called the command line, console, or shell) is a text-based way to control your computer. Instead of clicking icons, you type commands.
For most people, this is intimidating at first. But you only need to know about ten commands to do everything in this course. By the end of this lesson, you'll know all of them — and the terminal will stop feeling like a hacker movie and start feeling like a tool you own.
Why The Terminal?
A more important question to most people is: Why do we need the terminal when we have a nice GUI (graphical user interface)?
Short answer: Pure efficiency and more features.
Long answer: Typing is often much faster than clicking through an interface. Power users often say that "their fingers never have to leave the keyboard [to reach for their mouse]". Also, you are exposed to all the raw commands and operations you can do that a GUI doesn't expose.
How To Open The Terminal
On Mac:
- Press
Cmd + Spaceto open Spotlight - Type
Terminal - Press Enter
Or go to Applications → Utilities → Terminal.
On Windows:
- Press
Win + X - Click Windows Terminal or PowerShell
On Linux:
- Press
Ctrl + Alt + Ton most distributions
The Prompt
When you open the terminal, you'll see something like:
davidcjw@Davids-MacBook ~ %
This is the prompt. It tells you:
- Your username (
davidcjw) - Your computer name (
Davids-MacBook) - Where you are (
~means your home folder)
The % or $ at the end means the terminal is waiting for you to type a command.
The 10 Commands You Need
1. pwd — Print Working Directory
Shows you where you are (what folder you're in).
pwd
# Output: /Users/davidcjw/Documents
2. ls — List Files
Shows the files and folders in your current location.
ls
# Output: Desktop Documents Downloads Movies Music
3. cd — Change Directory
Moves you into a folder.
cd Documents
# Now you're inside Documents
cd ..
# Goes up one level (back to where you were)
cd ~
# Goes to your home folder from anywhere
4. mkdir — Make Directory
Creates a new folder.
mkdir my-project
# Creates a folder called "my-project"
5. code . — Open VS Code
Opens the current folder in Visual Studio Code (requires VS Code installed — covered in the next lesson).
code .
# Opens the current folder in VS Code
6. npm install — Install Dependencies
Installs the packages a project needs to run. You'll use this when setting up projects.
npm install
# Installs everything the project needs
7. npm run dev — Start the Development Server
Starts your web app locally so you can see it in your browser.
npm run dev
# Output: ready - started server on http://localhost:3000
8. git commands
Version-control commands. We cover these in depth in a later module — for now, just know they exist.
9. Ctrl + C — Stop a Running Command
When something is running (like your dev server), press Ctrl + C to stop it.
10. clear — Clear the Screen
Clears all the text from your terminal screen. It doesn't delete anything — it just tidies up.
A Typical Workflow
Here's how these commands work together to set up a new project:
# 1. Open Terminal — you see: davidcjw@Davids-MacBook ~ %
# 2. Navigate to where you keep your projects
cd Documents
# 3. Create a new project folder
mkdir my-app
# 4. Go into it
cd my-app
# 5. Start Claude Code here (once it's installed — next lesson)
claude
That five-step pattern — navigate, create, enter, build — is the rhythm of nearly every project you'll start.
Understanding File Paths
A path is the address of a file or folder on your computer.
Absolute path — starts from the root of your drive:
/Users/davidcjw/Documents/my-project/index.html
Relative path — starts from where you currently are:
my-project/index.html
If you're in /Users/davidcjw/Documents/, both paths above point to the same file.
Two special shortcuts to remember:
| Shortcut | Meaning |
|---|---|
. (one dot) | Current folder |
.. (two dots) | Parent folder (one level up) |
~ (tilde) | Your home folder |
💡 Pro Tip
You can see the absolute path of your home directory with
echo $HOME.
Common Mistakes
Mistake 1: Being in the wrong folder
The most common beginner error. If a command isn't working, always run pwd first to confirm where you are.
Mistake 2: Typos in folder names
Folder names are case-sensitive on Mac and Linux. documents and Documents are different folders. Use ls to see the exact name.
Mistake 3: Forgetting a space
cd Documents has a space. cdDocuments does not — and won't work. Spacing matters.
Mistake 4: Panicking when something looks weird
Red text and error messages are normal. They are not dangerous. Read them. Ask Claude what they mean.
Asking Claude to Help with Terminal Errors
When you see an error in your terminal, copy the message and ask Claude:
"I got this error in my terminal. What does it mean and how do I fix it? [paste error]"
Claude is excellent at diagnosing terminal errors. Use it liberally — there's no prize for struggling alone.
Practice: Try These Right Now
Open your terminal and run each command in order:
pwd— see where you arels— see what's herecd Desktop— go to your desktopls— see what's on your desktopmkdir test-folder— create a foldercd test-folder— go into itpwd— confirm where you arecd ..— go back upls— confirmtest-folderwas created
If any of these produce an error, paste it into Claude and ask what happened.
Summary
- The terminal is a text interface for controlling your computer — about ten commands cover this whole course.
- Open it: Spotlight → Terminal (Mac) or Win+X → Terminal (Windows).
- Essential commands:
pwd,ls,cd,mkdir,npm install,npm run dev,Ctrl+C,clear. - File paths come in two flavors: absolute (from root) and relative (from where you are).
- When you hit an error, don't panic — copy it and ask Claude.