What is a terminal, really?
Before you type a single command, it helps to know what you're typing into, what's reading it, and who actually does the work. Five minutes here saves an hour of confusion later.
It's a way to talk to your computer in text.
Your computer has always been able to take instructions. A click on a folder is an instruction. So is dragging a file to the Trash. The terminal is the same conversation, just in writing.
When you open Terminal.app on macOSWindows Terminal or PowerShell on Windowsa terminal emulator on Linux, you're opening a window with a blinking cursor. That's it. The cursor is waiting for a sentence. You type the sentence, press Enter, and the computer reads it.
There are four things in the room with you.
When you type ls and press Enter, four different
things have a job to do before you see a result. Mixing them up is the
single biggest source of "wait, what?" moments.
(type words)"]) T["Terminal
(a window)"] S(["Shell
bash · zsh · pwsh"]) K[["Kernel
(OS core)"]] H[(Hardware
disk · screen)] U -- "ls" --> T T -- keystrokes --> S S -- "open dir, list it" --> K K -- bytes --> H H -. bytes back .-> K K -. names .-> S S -. formatted text .-> T T -. pixels .-> U classDef you fill:#fde3d1,stroke:#ee8a5e,color:#7a3a18,stroke-width:2px; classDef shel fill:#fbeec2,stroke:#e8b53b,color:#6b4d05,stroke-width:2px; classDef kern fill:#dde3f9,stroke:#8398ea,color:#2a3577,stroke-width:2px; classDef hw fill:#e6e1d8,stroke:#a8a299,color:#4a443c,stroke-width:2px; classDef neutral fill:#ffffff,stroke:#cdc0a3,color:#1d1a14,stroke-width:1px; class U you class S shel class K kern class H hw class T neutral
The terminal is the dumbest thing in this list. It's just a window that shows text. The shell is the part that understands you. People confuse the two constantly, partly because most macOS users say "the terminal" when they mean "the shell."
Where did "bash" and "PowerShell" come from?
A shell is a program someone wrote. There are many of them, and they have a family tree. Knowing roughly which branch your shell sits on helps when you Google an error and the answer is for a different shell.
Two branches. The left side traces back to UNIX, born at Bell Labs in 1971.
Almost everything called a "shell" on a Mac or Linux machine is a
descendant of sh. The right side is the
Microsoft lineage, originally DOS, then cmd.exe, then PowerShell — a
deliberate fresh start.
Why this matters for you: bash and zsh are 95% the same. A tutorial written for bash will almost always work in zsh. PowerShell is different language, different conventions, and you can't paste bash snippets into it and expect them to work.
| Role | macOS | Windows | Linux |
|---|---|---|---|
| Terminal app | Terminal.app, iTerm2 | Windows Terminal | GNOME Terminal, Konsole, Alacritty… |
| Default shell | zsh |
PowerShell (pwsh) |
bash |
| Family | UNIX / POSIX | Microsoft / .NET | UNIX / POSIX |
| Open Terminal | ⌘ Space → "Terminal" | ⊞ Win → "Terminal" | Ctrl Alt T |
The filesystem is a tree.
Every file on your machine has a single home, reached by a path of folders. Your job in the terminal is to know which folder you're currently standing in — and to move around the tree.
Two ideas come out of this picture:
- Current directory — the folder you're "in" right now. The shell tracks this for you;
pwdon Mac/Linux (pwdalso works in PowerShell) prints it. - Home directory — your personal folder.
~is shorthand for it on Mac/Linux;$HOMEworks everywhere modern.
Anatomy of a command.
Every command you type has the same shape. Once you see the shape, every other command becomes pattern-matching instead of memorization.
- Command — what to do.
lsmeans "list." - Flags — how to do it.
-lmeans "long,"-ameans "all." They can stack:-la. - Arguments — what to do it to. The folder, the file, the website.
- Cmdlet — what to do, spelled as Verb-Noun.
Get-ChildItemmeans "get the children of this location." - Parameter — how to do it. PowerShell uses full words after a single dash:
-Force,-Recurse. They don't stack the way Unix one-letter flags do. - Arguments — what to do it to. The folder, the file, the value to pipe in.
Most commands accept --help on Mac/Linux, and -? or Get-Help on PowerShell. When in doubt, ask the command what it can do.
Same idea, different words.
The reason this course teaches concepts first: once you know the concept, the command name is just a label. Here are the ten labels that change between operating systems. The idea is identical in each row.
| What you want to do | macOS / Linux | Windows (PowerShell) |
|---|---|---|
| Where am I? | pwd | pwd or Get-Location |
| What's in this folder? | ls | ls, dir, or Get-ChildItem |
| Move into a folder | cd folder | cd folder |
| Go back one level | cd .. | cd .. |
| Go home | cd ~ | cd ~ or cd $HOME |
| Make a folder | mkdir my-stuff | mkdir my-stuff |
| Make an empty file | touch notes.txt | New-Item notes.txt |
| Show file contents | cat notes.txt | cat notes.txt or Get-Content |
| Copy a file | cp a.txt b.txt | cp a.txt b.txt or Copy-Item |
| Move / rename | mv old new | mv old new or Move-Item |
| Delete a file | rm note.txt | rm note.txt or Remove-Item |
| Clear the screen | clear | clear or cls |
When something goes wrong.
Errors in the terminal are not punishments. They are the kernel or the shell telling you, often quite precisely, what they couldn't do. Three you'll see in your first week:
Read errors the way you'd read a sign on a door. They're short, literal, and almost always honest about what happened.