Command Palette

Search for a command to run...

Hectal
PHASE 0Beginner ~13 min· topic 2 of 4

Topic 0.2

The Shell, the Terminal, and Your First Commands

In one line

The terminal is just a window; the SHELL is the actual program reading what you type and running it — understanding that split, plus five commands, covers most of what you'll type in a given day.

0/4 · 0%

Think of it like this

A terminal is like a phone, and the shell is like the person you're actually talking to on the other end. Different phones (terminal apps — Terminal.app, Windows Terminal, iTerm2) can all connect you to the same person (the shell — usually bash or zsh); the phone itself doesn't understand your words, it just relays them.

Key ideas

  1. 01

    bash (Bourne Again SHell) is the most common default shell on Linux servers; zsh is common on modern Macs and increasingly Linux desktops. Nearly everything in this course works identically in both — the differences that matter show up mainly in scripting (Phase 6) and prompt customization, which we won't dwell on.

  2. 02

    pwd (print working directory) tells you exactly where you are in the filesystem right now — the single most useful command when you feel lost, and the first thing to run when a command mysteriously 'can't find' a file.

  3. 03

    ls lists what's in the current directory. ls -l shows a detailed, one-per-line view (permissions, owner, size, date — Phase 1 decodes every column). ls -a additionally shows HIDDEN files (anything starting with a dot, like .env or .gitignore), which are hidden from a plain ls by convention, not by any real security mechanism.

  4. 04

    cd changes your current directory. cd .. moves UP one level (to the parent directory), cd ~ (or bare cd) jumps straight to your home directory, and cd - jumps back to whichever directory you were in immediately before — a genuinely useful shortcut once it's muscle memory.

  5. 05

    man <command> (manual) opens the full, authoritative documentation for any command, right in your terminal, with zero internet connection required — press q to exit. It's verbose and terse by design, but it's the one source that's always accurate and always available on the machine you're actually working on.

Code & diagrams

first-commands.shmarkdown

Run these in order in any real terminal — reading the actual output matters more than reading this list.

# Where am I right now?
pwd

# What's in this directory? (including hidden files)
ls -a

# The detailed, one-per-line view
ls -l

# Move into your home directory explicitly
cd ~
pwd

# Jump back to wherever you just were
cd -
pwd

# Read the full manual for a command you'll use constantly
man ls
# (press q to exit)

Explain it without notes

01

What's the actual difference between 'the terminal' and 'the shell,' and why does that distinction matter in practice?

02

Why does ls hide files starting with a dot by default, and is that a real security measure?

Practice

01

From your home directory, navigate three levels deep into any subfolder structure using cd, then use cd - repeatedly and predict what directory you'll land in each time before running it.

02

Run ls -la (combining both flags) on your home directory and find at least one dotfile you didn't know existed — look it up or open it with cat to see what it's for.

Trade-offs

  • ↔

    Memorizing man pages verbatim isn't the goal — knowing the five or six commands you'll type dozens of times a day cold, and knowing man <command> exists for everything else, is a far better use of memory than trying to front-load every flag of every tool before you've needed them.

Done when you can

  • I understand the terminal is just a window and the shell is the program actually running my commands.

  • I can navigate anywhere in a filesystem using pwd, ls, and cd without hesitating.

  • I know man <command> exists and have used it at least once for real.