AI Learning Hub › Learn AI › Self-Paced Courses › Terminal on Mac: Reading Commands Before You Run Them › Where This Came From
Sources
Where This Came From
Everything this course asserts comes from one of three places: Apple’s Terminal User Guide, a manual page installed on macOS, or a controlled observation made in a disposable folder during development. Where a statement is an inference from one of those rather than something any of them says, this page marks it as one.
A maintained record mapping each claim to its source lives with the repository as docs/terminal-mac-course-source-log.md.
Versions and dates
Live observations were made during October 2026 on macOS 26.6.2, with zsh 5.9 and Terminal 2.15.
They were run through /bin/zsh -f — a shell that reads no personal configuration — with explicit /bin and /usr/bin paths. That matters more than it sounds. Early checks during development produced wrong answers because the development machine’s PATH resolved grep and find to third-party replacements with different behavior. Anyone verifying this material should do the same, and anyone writing a tutorial from their own terminal should know the trap exists.
Apple documentation
- Change the default shell (opens in a new tab) — that zsh is the default shell on macOS. Module 1.
- Execute commands and run tools (opens in a new tab) — that you work interactively by typing a command and waiting for a result, and that the folders the shell searches for a command are listed in its
PATH. Modules 1 and 8.
Apple’s guide does not define command, option or argument as terms. The three-part model in Module 3 is this course’s own, built to match the vocabulary the manual pages use rather than invented alongside it.
Manual pages
Read on the machine named above, which is also where you can read them: man ls, man rm, and so on.
- rm(1) — that
rmprompts for confirmation only when a file is not writable and input is coming from a terminal. Module 5. - open(1) — that
openopens a file “just as if you had double-clicked the file’s icon,” and that its arguments are interpreted relative to the current working directory. Module 2. - sudo(1) — that
sudo“allows a permitted user to execute a command as the superuser or another user, as specified by the security policy.” Module 8. - termios(4) — that the interrupt character sends
SIGINTto every process in the terminal’s foreground process group. Module 8. - less(1) — that
qquits the pager, which is how you leave a manual page. Module 3. - ls(1), cp(1), grep(1), find(1), mkdir(1) — read for their option lists and for the
SYNOPSISconventions Module 3 teaches: square brackets mark something optional,...marks something repeatable, and the options are listed under a heading that reads either “The options are as follows” or “The following options are available” depending on the page. “Option” is the manual’s term; “flag” is the informal synonym you will meet elsewhere.
Live observations
Each of these was run in a disposable copy of the practice folder, never against anything that mattered.
| Observed | Result | Module |
|---|---|---|
cp and mv onto an existing file | Replaced it, no prompt | 4 |
rm on a writable file | Removed it, no prompt, no output | 5 |
rm on a folder | is a directory; rm -r removes it | 5 |
cp on a folder | is a directory (not copied); cp -R copies it | 4 |
touch on an existing file | Changed its timestamp, kept its contents | 4 |
cat My Research File.txt unquoted | Three errors, one per word | 3 |
| The same command quoted or escaped | Printed the file | 3 |
find . -name "*.txt" | Worked | 6 |
find . -name *.txt unquoted | zsh: no matches found: *.txt, before find ran | 6 |
| A wildcard with nothing to match, in zsh | no matches found, and the command does not run | 5 |
> onto a file with contents | Replaced them; >> added to the end | 7 |
&& after a command that failed | The second command did not run | 7 |
open . | A Finder window opened on the current folder | 2 |
| Tab after a partial path | Completed it, escaping spaces by itself | 3 |
| Pasting a multi-line block into Terminal | Staged every line; one Return ran them all | 9 |
The four error messages in Module 8 and the screenshots throughout are from the same sessions.
Two statements that are inferences
That rm is not the Finder’s move-to-Trash. The rm manual page never mentions the Trash: it describes removing files, and describes no undo and no recovery step. Module 5 therefore says you should not expect to find the file in the Trash, and stops there. It does not claim recovery is impossible by any means, because that is a stronger statement than reading the manual supports.
That the moment before Return is the checkpoint. This is the course’s thesis rather than a quotation. It follows from the observations above — cp, mv, rm and > all do their work without asking — and from the absence of anything in the documentation describing a confirmation step.
What this course could not establish
A course about reading before running should say where its own evidence stops.
- Dragging a file from Finder into Terminal to insert its path. Widely reported, never observed here: the development environment refuses synthetic mouse gestures, so it could not be tried. The course omits it rather than describing something it has not seen, and teaches Tab completion instead, which was verified and which handles the same problem.
- Control+C in practice. Module 8 describes it from
termios(4), not from a live interrupt. Stopping a running command needed a long-running foreground process in an interactive session, which was out of scope here. - Whether a removed file can be recovered by any means. Not investigated, and the course makes no claim either way.
- macOS privacy prompts. macOS may ask before Terminal reads your Desktop, Documents or Downloads. No such prompt appeared during development, because everything ran in a temporary folder that is not a protected location. The course mentions the possibility in one sentence and tells you nothing about granting access, because it has not watched that happen.
- Windows and Linux. Every observation here is macOS with zsh. Nothing in this course should be read as a statement about any other system.
- Whether your Mac runs zsh. Apple documents it as the default, but an account migrated from an older version of macOS may still use bash. Module 1 shows you how to check rather than assuming.
What was never run
No sudo command was executed at any point in making this course. The manual page was read, which is where Module 8’s description comes from. No password was typed, and no credential prompt appears in any screenshot.
Nothing destructive was ever run outside a disposable copy of the practice folder.
Screenshots
Every terminal screenshot in this course was taken in a temporary folder with a deliberately plain prompt. A standard macOS prompt shows your account name and your computer’s name, so an unaltered screenshot would carry both. Your own prompt will look different from the images, and that is expected — the commands and their output are the part to compare.
The practice folder
The download was written for this course. The case names, the opinions and the research notes are invented, and no part of it comes from a real matter. It contains no personal information and no credentials.
It is also deliberately small enough to delete and re-extract in a few seconds, which is what makes the exercises safe to get wrong.