learn.colinkim.dev

Introduction

Understand what the terminal actually is, what a shell does, how your operating system fits in, and what happens each time you type a command.

The terminal looks different from ordinary apps:

  • there are no large buttons
  • commands must be typed exactly
  • errors appear as plain text
  • simple tasks can seem harder than they do in a graphical interface

It is not hard because it is magical. It exposes more of the computer’s structure directly. Once that structure makes sense, the terminal becomes predictable.

The terminal emulator

A terminal emulator is an application that gives you a text-based window to type commands into. It does not interpret your commands. It simply provides the window where text appears.

Common terminal emulators include:

  • Terminal.app (macOS)
  • iTerm2 (macOS)
  • GNOME Terminal, Konsole, Alacritty, Kitty (Linux)
  • Windows Terminal (Windows)

The terminal emulator is just a window. The program that reads what you type inside it is different.

The shell

A shell is the program that reads the commands you type, interprets them, and runs the corresponding programs.

When you open a terminal emulator, it usually starts a shell session automatically. That is why the two are often confused.

Common shells include:

  • zsh — the default shell on modern macOS
  • bash — the default shell on most Linux distributions
  • fish — a user-friendly shell with helpful defaults
  • PowerShell — Microsoft’s shell, built into Windows
  • Command Prompt (cmd) — the older Windows command interpreter

What happens when you type a command

Understanding this sequence removes a lot of the mystery:

  1. You type text into the terminal emulator window.
  2. The shell reads the text and parses it into a command name and arguments.
  3. The shell looks up the command in your PATH (a list of directories where executable programs live).
  4. The shell runs the program.
  5. The program produces output (or makes changes) and exits.
  6. The shell prints a new prompt, ready for the next command.

If the shell cannot find the command, it prints an error. That usually means the program is not installed, not in your PATH, or the name was typed incorrectly.

Commands are programs

Every command you type is just a program on your computer. Commands are not magic built into the shell — they are executable files.

Commands typically have:

  • inputs — files or data they read
  • options — flags that change their behavior
  • outputs — text they print or files they create

For example, ls is a program that lists directory contents. cat is a program that reads a file and prints it to the terminal. grep is a program that searches text.

Knowing that commands are programs helps demystify the terminal. Each command is just a small, focused tool doing one job.

Why developers use the terminal

Many developer tools are designed to be run as commands:

  • Git for version control
  • npm or pnpm for package management
  • development servers
  • test runners
  • linters and formatters
  • build tools

That has practical advantages:

  • commands are fast to repeat
  • commands can be written in documentation exactly
  • commands work well in automation
  • commands can be combined into workflows

That is why the terminal keeps showing up even when a tool also has a graphical interface.

A good beginner focus

Memorizing commands is not the goal. Understanding a small model is:

  • where you are in the filesystem
  • what files are here
  • what command you want to run
  • what arguments it needs

That model matters more than any single command. The rest of this course builds it step by step.

Progress

Quick checks

No quick checks in this lesson.

Mark lesson manually or answer quick checks to track progress.