Claude Code lives in the terminal. Every lab in this course starts with you typing a command into a dark window, and if that window makes your shoulders tense, the tension will quietly tax everything you build on top of it. The fix is not a 400-page book. It is about fifteen commands, two concepts, and an hour of your hands on the keys.
The map
A terminal is a text conversation with your computer. You type a command, the shell (the program running the conversation, usually zsh on macOS or bash on Linux) finds the matching program, runs it, and shows you what it printed. That is the whole model. Everything below is vocabulary for that conversation.
You are always "in" a directory, called the working directory. Commands operate relative to it unless you give a full path. The core moves:
pwdprints where you arelslists what is here (ls -laincludes hidden files and details)cd somewheremoves you (cd ..goes up one level,cdalone goes home)mkdir -p a/bcreates directories, including parentscat fileprints a file's contentscp from tocopies,mv from tomoves or renames,rm filedeletesfind . -name "*.txt"searches for files by name from here downgrep word fileprints lines in a file containing a word
Two operators turn commands from single moves into sentences. The redirect > sends a command's output into a file instead of the screen, overwriting the file; >> appends instead. The pipe | feeds one command's output into the next command's input. grep hot leads.txt | wc -l means "find the lines containing hot, then count them." Small tools, composed. That composition style is the terminal's entire personality, and it is also how you will read half the commands Claude Code proposes to run.
Two concepts explain almost every beginner error:
Permissions. Every file carries flags for who may read, write, or execute it. A fresh script is not executable, so running ./report.sh fails with permission denied until you run chmod +x report.sh. When you see permission denied, your first thought should be "flags," not "I am in trouble."
Environment variables and PATH. The shell keeps named values, like REGION=us-east, that programs can read. Set one with export REGION="us-east", read it with echo $REGION. One of these variables, PATH, is a list of directories the shell searches when you type a command name. command not found almost always means the program is not installed or its directory is not on PATH. Those two errors, permission denied and command not found, account for most early terminal grief, and now you can diagnose both.
Tutor first
Before the gauntlet, calibrate. This prompt gives Claude the job of finding your actual level and drilling exactly there:
You are my terminal tutor. I am learning to work in a Unix shell. Quiz me one question at a time, every question applied: "what command would you type to accomplish X" or "what will this pipeline print." Start easy (navigation, listing files) and escalate through pipes, redirection, permissions, and PATH. When I miss one, have me type the real command in my terminal and report back what happened before you continue. Stop after 10 questions and list what I should drill again tomorrow.
The gauntlet
Real reps, in your real terminal, with a check after every step. Type every command yourself. Copy-paste teaches your clipboard.
Lablab-p-2The terminal gauntlet
Goal: Run one continuous scenario that exercises navigation, files, pipes, redirection, variables, permissions, and cleanup, verifying each step.
Open your terminal. macOS: the Terminal app. Windows: install WSL first (search "install WSL", it is one command in PowerShell), then use its Ubuntu shell. Linux: you know where it is.
- Find out where you are, then go home and set up a workspace:
pwd
cd
mkdir -p practice/inbox practice/archive
cd practiceCheck: pwd now ends in /practice. ls shows archive and inbox.
- Create a file with redirection, then append to it:
echo "Dana Whitfield - hot - demo booked" > inbox/leads.txt
echo "Marcus Lee - warm - opened email" >> inbox/leads.txt
echo "Priya Nair - hot - asked for pricing" >> inbox/leads.txt
cat inbox/leads.txtCheck: cat prints exactly three lines, in that order. If you see one line, you used > where you meant >> and overwrote your own work. Rebuild the file; that mistake is the lesson.
- Copy, then rename:
cp inbox/leads.txt archive/leads-backup.txt
mv inbox/leads.txt inbox/leads-monday.txt
ls inbox archiveCheck: inbox contains only leads-monday.txt; archive contains leads-backup.txt. Note that rename and move are the same command.
- Search and compose. How many hot leads?
grep hot inbox/leads-monday.txt
grep hot inbox/leads-monday.txt | wc -lCheck: the first command prints the Dana and Priya lines. The second prints 2 (possibly padded with spaces; that is fine). Say the second command out loud as a sentence: find the hot lines, count them.
- Set an environment variable and read it back:
export REGION="us-east"
echo $REGIONCheck: prints us-east. Now open a second terminal window and run echo $REGION there: empty. Environment variables live per shell session, which is exactly why deployment configs feel confusing later. You just learned the reason in ten seconds.
- Write a script, hit the permissions wall, fix it:
printf '#!/bin/bash\necho "Report for $REGION: $(grep -c hot inbox/leads-monday.txt) hot leads"\n' > report.sh
./report.shCheck: permission denied. Good, you were supposed to hit that. Now:
chmod +x report.sh
./report.shCheck: prints Report for us-east: 2 hot leads. One command, three of today's concepts working together: a variable, a permission fix, and a grep.
- Find files, then clean up deliberately:
find . -name "*.txt"
rm archive/leads-backup.txt
ls archiveCheck: find listed both txt files with their paths; after rm, ls archive prints nothing. There is no trash can here. rm is forever, which is why you will learn git next lesson and stop fearing it.
Verify
./report.shruns and reports 2 hot leads.- You can explain, without looking, what
grep hot file | wc -ldoes and why>destroyed your file in step 2 if it did. echo $PATHprints a colon-separated list of directories, and you can say in one sentence what the shell uses that list for.
>Troubleshooting
command not foundon something from this lab. You are probably not in a bash or zsh shell (Windows PowerShell will fail on most of these). Confirm withecho $0. On Windows, everything in this course happens inside WSL.No such file or directory. You are not where you think you are. Runpwdandls, reorient, continue. This reflex (pwd, ls, breathe) solves a third of all terminal problems.- The script prints 0 hot leads. Check that
inbox/leads-monday.txtstill exists and has three lines withcat, and that you are running the script from inside thepracticedirectory, since its grep uses a relative path.
Where it breaks
The classic self-inflicted wounds, so you recognize them early. Overwriting a file with > when you meant >> you just did on purpose. Running rm with a wildcard you did not test first: before any rm with a * in it, run ls with the same pattern and look at what matched. And the big one culturally associated with terminals, sudo: it runs a command as the system administrator. You will need it rarely, and a beginner reflex of "add sudo until it works" turns small permission questions into system-level mistakes. If a command fails without sudo, ask your tutor why before escalating.
One more habit worth installing now: when Claude Code later proposes terminal commands, you will approve them before they run. Approving a command you cannot read is signing a contract you cannot read. This lesson is what makes those approvals informed consent instead of a reflex.
Knowledge check
Knowledge check
Sources
This lesson teaches shell fundamentals that have been stable for decades: no version-sensitive claims to cite. When you meet a command you do not recognize, man pages and your tutor prompt are the primary sources. Every gauntlet command and its expected output was executed and verified during authoring (July 2026).