shio

~/shio.sh/learn/what-is-a-terminal $ ./read

chapter 01 · learn the terminal

What is a terminal?

A terminal is a room with one door, lit by a blinking cursor. You type a sentence; the computer reads it. A gentle introduction to the command line.

$ a small definition

A terminal is a window where you type sentences and a computer reads them. The computer's reply appears right below what you typed. That's the whole loop.

What runs inside the terminal — the thing that actually reads your sentences — is called a shell. On a Mac, the default shell is named zsh. On most Linux machines, it's bash. They're slightly different dialects of the same language; for everything we'll learn here, they behave the same.

When people say "the command line" or "the CLI," they mean this place. Same room, different names.

$ anatomy of a prompt

Look closely at the bottom of any terminal. There's a line waiting for you. It usually looks something like this:

~/shio.sh/learn $ 

Three parts:

  • ~/shio.sh/learn — where you are. The ~ is shorthand for your home folder.
  • $ — the sigil. It means "your turn." A blinking cursor sits to the right of it, waiting.
  • Everything you type after the $ is one sentence. You press Enter to send it.

Some systems use % or # instead of $. Don't worry about that. The job of the sigil is just to mark where your turn begins.

$ try saying hello

Below is a real shell. Not a video, not a screenshot — a working terminal in this page. Type echo hello and press Enter.

echo is the simplest command there is. It takes a sentence and prints it back. We're starting here on purpose.

try: echo hello

$ what just happened

You wrote a sentence. The shell read it, found a small program named echo, handed it your word hello, and printed the result.

That's the rhythm of every command, forever. You type a verb (the command), maybe with some nouns (arguments), press Enter, and the shell takes care of the rest.

Next chapter, we'll learn the three commands you'll use a hundred times a day: pwd, ls, and cd.

~/shio.sh/learn/what-is-a-terminal $ cd ..