Starting point and question
A terminal window is open. A note says /bin/zsh, but a process report says bash. Which program is interpreting the command, and what can each source prove?
I ask you to write TM-S01-R using the supplied fictional case. You will identify four roles, compare a variable with a process report, and state what remains unknown. Paper or an existing editor is enough; no installation, account or previous terminal experience is needed.
Separate the roles before the commands
| Role | Meaning in this lesson |
|---|---|
| Terminal | A program that accepts keyboard input and displays text. It can host different shells. |
| Shell | A command interpreter: a program that reads command-language instructions and carries them out. |
| Operating system | Software providing the services programs use; it includes a kernel and other parts. |
| Kernel | The core that manages resources such as memory, processes and access to devices. A process is a running program instance. |
The terminal passes input to the program connected to it and displays output. A shell can run an internal command (builtin) itself, or start an external program. In Bash, echo is normally internal; uname is normally external. The kernel does not interpret shell syntax or compose every displayed result. Programs can write output directly to the terminal; it need not travel back through the shell.
A system call is a controlled request a program makes for a kernel service, not a human-language command. “Person → terminal → shell → program/kernel” is only a simplified model. An internal command need not start a separate external program. Shells also run scripts, files containing instructions; scripting is taught later.
Read TM-S01 one source at a time
Fictional case, 2026-10-19, UTC+02:00. G1 at 09:00: read four excerpts from one declared Bash session on lab-shell. No real connection or system change is requested. lab-shell is a fictional system name, not an address to contact. The blocks display supplied commands and outputs; they do not execute them.
A command is an instruction; an argument supplies a value and an option selects behavior, often beginning with a hyphen. A prompt is the text indicating readiness to accept input; do not copy a displayed prompt marker with the command.
R1, 09:01: read a variable, not a verdict
A variable associates a name with a value. echo displays text; $SHELL asks the shell to substitute the value named SHELL. Double quotes keep that value together as one argument and are not printed.
R1 reports /bin/zsh, a path, the location/name of a program in the file tree. SHELL commonly describes a login-shell setting and can be inherited or changed. This value alone does not identify the current interpreter. A blank result would not prove that no shell exists.
R2, 09:02: inspect the session's process
A PID (process identifier) is a number identifying a process. In this Bash/Zsh interactive use, $$ supplies the shell process ID. ps reads process information; -p selects that ID and -o comm= requests the command name with no column heading.
R2 reports bash for that selected process. Together with the declared session, it supports Bash here, even though R1 says /bin/zsh. Output may include a path on another system. This is a scoped process observation, not proof of the exact executable version or that the terminal application is Bash. H1 “a child Bash was started from Zsh” is plausible but not established by these excerpts.
R3, 09:03: read the kernel name
uname reports system information; -s requests the kernel/implementation name.
Linux names the kernel in this supplied session. It does not identify the terminal application, the precise Linux distribution, or the physical computer running the browser. A remote session or a Linux environment on a Windows host can differ from the machine displaying the terminal.
R4, 09:04: read a longer system summary
The -a option asks uname for a broader summary. This line is illustrative, not a real release to install.
Here Linux is the kernel name, lab-shell the node name, 6.8.0-demo the kernel release, #1 SMP version information, x86_64 a reported machine type and GNU/Linux the GNU utility's operating-system label. Architecture describes a machine/instruction family, not an identity or guaranteed physical hardware. Field availability differs between systems; -a is not a full inventory or an exact distribution detector. Do not assume each whitespace-separated word is a separate fixed field.
Compare conclusions with sources
A useful TM-S01-R says: “R1 holds /bin/zsh; R2 reports bash for the selected session process; R3 reports Linux; R4 adds system information. The terminal application, exact distribution and reason for the mismatch remain unknown. H1 is unverified.”
Check three criteria: K1, name terminal, shell, operating system and kernel separately; K2, distinguish the value in R1 from R2's process report; K3, keep R3/R4 scoped and state unknowns. This checks your explanation, not mastery of Linux.
Bash means Bourne Again Shell and is this course's reference shell, not a universal requirement. Zsh (Z shell), fish (friendly interactive shell) and sh are other shell names; their languages are not interchangeable. Windows Terminal is a terminal host and PowerShell is a different shell. Later lessons develop these distinctions.
Optional reading on your own existing session
The supplied case is enough. If you already know you have an interactive Bash or Zsh session on Linux or macOS, you may type the four input lines above one at a time and press Enter after each. No directory or file preparation is needed. These commands read a variable and system/process information; they do not change settings.
Keep your actual outputs separate from TM-S01, with the session, command and source. Do not change SHELL to make it match the example. Darwin is a possible uname result on macOS. If a command is unavailable or denied, keep the error and stop that check; no administrator privileges or installation are needed. On native PowerShell/cmd, do not paste this Bash/Zsh syntax: use the supplied case instead. An existing Linux session on Windows is a separate environment, not proof of native Windows behavior.
The associated Foundations challenge includes file operations and later prerequisites. Return to it after the relevant lessons; it is not a prerequisite for this explanation.
Sources: GNU shell role, builtins, SHELL, uname, ps. Local system manuals cover platform differences.
Exercises
Exercise 1: Which source identifies which role?
Fictional TM-S01, 2026-10-19 UTC+02:00: G1 09:00 reading only, declared Bash session lab-shell. R1 09:01 echo "$SHELL" gives /bin/zsh; R2 09:02 ps -p "$$" -o comm= gives bash; R3 09:03 uname -s gives Linux; R4 09:04 uname -a gives Linux lab-shell 6.8.0-demo #1 SMP x86_64 GNU/Linux. SHELL is a variable value, ps reports a selected process and uname system information. No real execution required.
Write TM-S01-R in 2–5 minutes. Explain why R1/R2 can differ, what R2 supports and why H1 “Bash started from Zsh” remains unverified. Apply K1 roles, K2 variable/process, K3 scoped system information and unknowns.
Exercise 2: What does uname establish?
Fictional TM-S01, 2026-10-19 UTC+02:00: G1 09:00 reading only, declared Bash session lab-shell. R1 09:01 echo "$SHELL" gives /bin/zsh; R2 09:02 ps -p "$$" -o comm= gives bash; R3 09:03 uname -s gives Linux; R4 09:04 uname -a gives Linux lab-shell 6.8.0-demo #1 SMP x86_64 GNU/Linux. SHELL is a variable value, ps reports a selected process and uname system information. No real execution required.
Correct “R3 proves the browser computer runs this exact Linux distribution; R4 identifies a physical machine and the terminal.” Use K1 roles, K2 source types, K3 unknowns. Explain the parts of R4 using the supplied model.
Exercise 3: Explain the path of a command
Fictional TM-S01, 2026-10-19 UTC+02:00: G1 09:00 reading only, declared Bash session lab-shell. R1 09:01 echo "$SHELL" gives /bin/zsh; R2 09:02 ps -p "$$" -o comm= gives bash; R3 09:03 uname -s gives Linux; R4 09:04 uname -a gives Linux lab-shell 6.8.0-demo #1 SMP x86_64 GNU/Linux. SHELL is a variable value, ps reports a selected process and uname system information. No real execution required.
Explain terminal, shell, operating system and kernel in your own words. Explain why internal echo and external uname need not follow the same execution path. Keep K1–K3 and identify one unknown. K1 checks the four roles, K2 variable versus process and K3 the limits of uname and unknowns.
Flashcards
Terminal or shell?
Answer
The terminal handles text input/output; the shell interprets a command language. They are different programs.
Next, compare command-line and graphical interfaces by the task and its constraints, without assuming either is always better.
