Terminal basics in 5 minutes, and what to do when it replies "command not found".
What the terminal is
The terminal is a window where you type instructions, one per line. You hit Enter, the system runs it and replies in text. No mouse or buttons.
Claude Code runs inside it. When you type claude in a folder, the terminal handles the rest.
You don't need to become an expert. Six commands cover the essentials.
Open the terminal on Mac
- Press
Cmd + Space(this opens Spotlight) - Type
Terminal - Hit Enter
A black or white window opens with a blinking cursor. You're ready.
Open the terminal on Windows
- Press
Win + X - Pick Windows PowerShell or Terminal
If you don't see those options, type PowerShell in the Start menu search bar.
The 6 commands to know
| Command | What it does | Example usage |
|---|---|---|
cd | Changes folder | cd ~/Documents/my-project |
ls (Mac) / dir (Windows) | Lists the files in the current folder | ls shows everything in there |
pwd | Shows where you are in the folder tree | pwd returns /Users/you/Documents |
mkdir | Creates a folder | mkdir my-project |
open . (Mac) / explorer . (Windows) | Opens the current folder in Finder or Explorer | open . after a cd ~/Documents |
clear | Clears the terminal window | clear to start from a blank page |
The ~ is a shortcut for your home folder (e.g. /Users/your-name on Mac, C:\Users\your-name on Windows). The . means the current folder.
PATH in 2 sentences
PATH is the list of folders the system searches for programs when you type a command. When you install Claude Code, it adds its folder to PATH so you can type claude from anywhere.
If you see claude: command not found, PATH hasn't been reloaded. Close and reopen the terminal, or type source ~/.zshrc on Mac to force the reload.
3 classic errors and how to fix them
permission denied: you're trying to do something that needs admin rights. Prefix the command with sudo and type your Mac password. Example: sudo mkdir /usr/local/my-folder.
command not found: the system can't find the program. Either it isn't installed, or PATH hasn't been reloaded. Close the terminal and reopen it, or run source ~/.zshrc again (Mac).
no such file or directory: the path you typed doesn't exist. Check where you are with pwd, then what's in the current folder with ls. Tab autocomplete saves you from typos.