Finding the Terminal
Before we can enter commands, we need to launch the Terminal application. The fastest way on a Mac is using Spotlight Search.
- Click the Cmd ⌘ + Space button in Step 1 below.
- Click the search icon in the mock menu bar on the right.
Your Mission:
- Press or click to open Spotlight search.
- Type terminal in the search bar.
- Press Enter ↵.
Where am I? (pwd)
Unlike the visual Finder, the terminal puts you in a specific folder but doesn't immediately show you where that is. The command pwd stands for Print Working Directory. It tells you your exact current location.
Your Mission:
Find out where you are by typing pwd and hitting Enter.
What's here? (ls)
Now that you know you are in your Home folder, what else is here? The ls command stands for list. It shows you all files and folders in your current location.
Your Mission:
List the contents of your directory by typing ls.
Moving around (cd)
You saw a 'Documents' folder in the previous step. Let's go inside it. The cd command stands for Change Directory. Note: It is case-sensitive!
Your Mission:
Navigate into Documents by typing cd Documents.
Creating Workspaces (mkdir)
Before starting an AI coding project, you usually want an empty folder. The mkdir command stands for Make Directory.
Your Mission:
Create a new folder named 'ai-project' by typing mkdir ai-project.
Step Inside
Now go into the folder you just created.
Your Mission:
Type cd ai-project.
Prerequisites (node -v)
Claude Code runs on Node.js. It's common to check if a program is installed by asking for its version using the -v or --version flag.
Your Mission:
Check your Node version by typing node -v.
The Magic Tilde (~)
You might have noticed the ~ symbol in your prompt. In Mac/Linux, the tilde is a shortcut for your personal Home folder (/Users/developer).
Typing the tilde can be tricky!
- German Mac: Press Option + N
- US Mac: Press Shift + ` (next to 1)
No matter how deep you are in your folders, you can always instantly warp back to your home folder by typing cd ~. Let's get out of the ai-project folder.
Your Mission:
Jump back to your home directory by typing cd ~.
Reading Files (cat)
Now that you are back home, let's look at a file. If you run ls you might remember seeing .bash_profile. (Files starting with a dot are usually hidden configuration files).
To quickly read the text inside a file without opening a heavy editor like VS Code, you can use the cat command (short for concatenate).
Your Mission:
Read the contents of your profile by typing cat .bash_profile.
The Panic Button: Ctrl + C
This is the most important survival skill. Sometimes an AI agent script goes crazy, a server runs continuously, or you type a command that gets "stuck".
You can FORCE STOP almost any running terminal process by holding down Control and pressing C on your keyboard. Note: This is Control, not the Mac Command (⌘) key!
Your Mission:
1. Type ping localhost (This will run forever).
2. While it's running, press Ctrl + C to kill it.
You are Ready!
You've mastered the essential terminal commands. Here is a summary of your new superpowers:
-
1.
Cmd+Space- Opening the terminal via Spotlight search. -
2.
pwd- Knowing exactly where you are. -
3.
ls- Seeing the files and folders around you. -
4.
cd- Moving between different folders. -
5.
mkdir- Creating new folders (required to set up a workspace for Claude Code). -
6.
node -v- Checking for prerequisites (Claude Code CLI needs Node.js). -
7.
cd ~- The magic tilde to instantly warp back to your home folder. -
8.
cat- Quickly reading the text inside a file. -
9.
Ctrl+C- The panic button to force-stop running or stuck processes.
Next steps in reality:
- Install Claude CLI:
npm install -g @anthropic-ai/claude-code - Authenticate:
claude auth - Start coding:
claude