Adds all 6 ROOT 01 modules (how computers run software, the shell, filesystem navigation, files & text, processes, users & permissions foundations), each with a real lesson, demonstration/guided exercise, knowledge check where warranted, a hands-on Lab, and a reflection — 35 activities, 29 new content files. Adds 6 new hands-on Linux scenarios (linux-inspect-hardware, linux-shell-basics, linux-filesystem-navigation, linux-files-and-text, linux-process-management, linux-permissions-foundations) plus 2 MCQ scenarios, using the existing generic scenario/ validation engine (docs/ROOT_FOUNDATIONS_LAB_STRATEGY.md §1) — every one tested end-to-end via the real scenario setup/validate API, including negative tests confirming they correctly FAIL when not actually solved (e.g. the process-management scenario fails while the target process is still running; the permissions scenario is tested against a real `su - labuser` denial). Wires rootnode-linux-foundations-assessment (2 required + 4 random-draw scenarios) using the existing Phase 3B assessment engine. Adds a real, server-side ROOT 01->02->03->04->05 course prerequisite chain (courses.prerequisites) — verified live on two students: one who completed ROOT 01 sees ROOT 02 unlock; a fresh student sees ROOT 02 correctly locked while 03/04/05 stay vacuously satisfied (their own prerequisite courses are still empty). ROOT 06+ and the Capstone are unaffected. Co-Authored-By: Claude Sonnet 5 <[email protected]>
1.4 KiB
1.4 KiB
Guided Exercise: Predict the Exit Code Before You Run It
This is a paper exercise — commit to an answer before checking it in the Lab.
Your task
For each command below, predict whether its exit code will be 0 (success) or non-zero
(failure), and why:
cat /etc/hostname(a file that exists)cat /etc/does-not-exist-at-all(a file that doesn't)grep root /etc/passwd(a pattern that's very likely present)grep zzz-not-a-real-user /etc/passwd(a pattern that's very likely absent)mkdir /tmp/already-exists && mkdir /tmp/already-exists(running the samemkdirtwice)
A worked shape to check yourself against
0— the file exists and is readable.- Non-zero — the file doesn't exist,
catfails. 0—grepsucceeds (exit 0) when it finds at least one match.- Non-zero (specifically
1) —grep"fails" when it finds NO matches, even though nothing went technically wrong. This is a common surprise:grep's exit code means "did I find a match," not "did an error occur." - The SECOND
mkdirfails (non-zero) — the directory already exists. The first one succeeds.
Instructor Notes
Facilitation: Item 4 is the one worth pausing on — many students assume "no error message"
means "exit code 0," and grep's no-match convention is a good early counter-example.
Approximate timing: 8-10 minutes live discussion; 5 minutes self-paced.