Terminal basics in 5 minutes, enough to never get stuck on a "command not found" again.
What the terminal is
The terminal is a window where you type instructions, one per line. You hit Enter, the system runs the command, and replies in text. No mouse, no buttons. Just text.
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 are enough to never get stuck.
Open the terminal on Mac
- Press
Cmd + Space(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.
6 vital commands
| Command | What it does | Example usage |
|---|---|---|
cd | Change directory | cd ~/Documents/my-project |
ls (Mac) / dir (Windows) | List files in the current folder | ls shows everything in here |
pwd | Print your current location | pwd returns /Users/you/Documents |
mkdir | Create a new folder | mkdir my-project |
open . (Mac) / explorer . (Windows) | Open the current folder in Finder or Explorer | open . after a cd ~/Documents |
clear | Clean up 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 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 ever see claude: command not found, it means PATH wasn't reloaded. Close and reopen the terminal, or run source ~/.zshrc on Mac to force the reload.
3 classic errors and their fix
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's not installed, or PATH wasn't reloaded. Close the terminal and reopen it, or run source ~/.zshrc (Mac).
no such file or directory: the path you typed doesn't exist. Check with pwd where you are, then with ls what's in the current folder. Tab autocomplete saves you from typos.