ch00 · beginner · 65-90 min

orientation and command grammar

Build the mental model before speed: terminal, shell, prompt state, command shape, help, and exit status.

You can explain what a command will act on, where it is running, and whether it succeeded.

orientationpromptmanualsexit statussafety
Teaching diagramch00 · mental model
read state, then act, then read the result1. prompt statewhoami / hostnamepwd / $SHELL2. command shapecmd -opts argsverify: man / --help3. exit statusecho $?0 ok / non-zero stopread stderr firstnon-zero?prompt theme shows, it does not prove

shows: The chapter's operator loop: read prompt state, parse the command into executable/options/arguments and verify it, run it, then read exit status and stderr before the next move.

does not prove: It does not prove a zero exit status means the intended effect happened, nor that the prompt's displayed host, path, or privilege are accurate; both must be confirmed with commands when consequences matter.

Lessons in this chapter

  1. ch00/l01 Terminal, shell, prompt whoami && hostname && pwd Separate the terminal window from the shell process, then read the prompt as state.
  2. ch00/l02 Command anatomy and help man ls Read commands as command, options, arguments, and input source.
  3. ch00/l03 Exit status and first failure reading echo $? Use exit status and stderr as evidence instead of blindly retrying.
capstone

session safety card

Create a one-page operator card for a new shell session: identify state, parse command shape, read help, classify failure.

Deliverable

A markdown note with four verified commands and one failed-command diagnosis.

Success criteria

  • You can identify user, host, path, and shell.
  • You can split a command into executable/options/arguments.
  • You do not rerun a failed command before reading the error.
Terminal Drill companion

Orientation

After you can narrate prompt state and command shape without looking at notes.

Train after the lesson