002
LVL 00 — CADET PILOT SESSION 002 DAY 2

THE TERMINAL

SYS.SCENARIO
🏢 The IT admin walks over: "At PixelCraft, we don't click around in file explorers. We use the terminal. It's faster, more powerful, and most importantly — scriptable. If you can type it, you can automate it. Every developer here lives in the terminal. Open it up."
CONCEPTS.UNLOCKED
The Shell
A text-based interface to your operating system. You type commands, the OS executes them. No clicking, no dragging — just text in, results out.
$_
Shell Types
Bash, Zsh, PowerShell — different shells with different features. macOS uses Zsh, most Linux uses Bash. The core commands are the same.
📍
Navigation
pwd (where am I?), ls (what's here?), cd (go somewhere). Three commands — you can traverse your entire file system.
📄
File Operations
mkdir (create dir), touch (create file), cp (copy), mv (move/rename), rm (delete). Create, read, modify, destroy — all from one line.
👁
Reading Files
cat (print all), less (scroll through), head (first N lines), tail (last N lines). See inside any file without opening an editor.
/
Paths & Directories
Absolute (/Users/name/Desktop) vs relative (./Desktop, ../). Special dirs: ~ (home), . (current), .. (parent), / (root).
HANDS-ON.TASKS
01
Where Are You?

Open the terminal. Type pwd. You're somewhere. Understand the path.

pwd # /Users/yourname (macOS/Linux) # C:\Users\yourname (Windows)
02
Look Around — ls Variations

See what's in your current directory with different levels of detail:

ls # basic listing ls -l # long format (permissions, size, date) ls -la # include hidden files (dotfiles) ls -lah # human-readable sizes (KB, MB, GB)
Hidden files start with a dot: .gitconfig, .zshrc, .bashrc — they're configuration files the OS hides by default.
03
Navigate — Build a Mental Map

Move around the file system. After each cd, run pwd to confirm where you are.

cd Desktop # go into Desktop cd .. # go up one level (parent) cd ~ # go home cd / # go to root of file system cd - # go back to previous directory
04
Create Your Workspace

Build your project workspace from scratch — no file explorer allowed:

mkdir -p ~/pixelcraft-workspace/notes mkdir -p ~/pixelcraft-workspace/practice cd ~/pixelcraft-workspace
The -p flag creates parent directories if they don't exist. Without it, mkdir fails if the parent is missing.
05
Create & Read Files

Write content to files and read it back:

echo "Day 2 at PixelCraft Inc." > notes/day2.txt cat notes/day2.txt echo "I learned the terminal today" >> notes/day2.txt cat notes/day2.txt
OperatorBehaviorExample
>Write (overwrite)echo "new" > file.txt
>>Appendecho "more" >> file.txt
06
Copy, Move, Rename, Delete
cp notes/day2.txt notes/day2-backup.txt # copy mv notes/day2-backup.txt notes/day2-copy.txt # rename rm notes/day2-copy.txt # delete forever
rm has no trash can. Deleted means gone. Use rm -i for confirmation prompts until you're confident.
07
Build a Directory Tree

Create this structure using ONLY terminal commands:

project/ ├── src/ │ ├── scripts/ │ ├── styles/ │ └── assets/ ├── docs/ └── README.md

Solution:

mkdir -p project/src/scripts project/src/styles project/src/assets project/docs touch project/README.md
CS.DEEP-DIVE

The REPL — Read-Eval-Print Loop.

The terminal is a REPL. It reads your command, evaluates (executes) it, prints the result, and loops back waiting for the next.

// The REPL pattern appears everywhere:

$ command → result     // Shell (Bash/Zsh)
>>> expression → value  // Python interactive
> expression → value   // Browser JS console
> expression → value   // Node.js REPL
=> query → result     // Database CLIs (psql, mongo)

// Same pattern. Different languages.
// The fundamental human-computer interaction.

Understanding REPLs means understanding the fundamental interaction model between humans and computers. Every tool you'll use in this course follows this pattern.

"Terminal Treasure Hunt"
[A] Given a pre-built directory tree with 20 hidden files, find all of them using only cd, ls -la, and cat.
[B] Each file contains a clue to the next one's location. Follow the chain from start to finish.
[C] Complete the entire hunt without opening the file explorer. Terminal only.
REF.MATERIAL
VIDEO
Joe Collins
Comprehensive beginner walkthrough of Bash — navigation, file operations, permissions, and more.
BASHBEGINNER
VIDEO
freeCodeCamp · Colt Steele
5-hour deep dive covering every essential command. Use as a reference — watch the sections you need.
LINUXCOMMANDSREFERENCE
ARTICLE
William Shotts
Step-by-step written guide to shell navigation, file manipulation, and I/O redirection.
SHELLTUTORIAL
BOOK
William Shotts (free PDF)
The definitive free book on the Linux command line. Chapters 1–5 cover this session perfectly.
LINUXCLIFREE
TOOL
cmdchallenge.com
Interactive browser-based terminal challenges. Great for drilling the commands from this session.
PRACTICEINTERACTIVE
// LEAVE EXCITED BECAUSE
You navigated your entire file system, created directories and files, and read content — all without touching the mouse. The terminal feels like a superpower. You typed commands and the computer obeyed instantly.