{ "id": "03-commands", "title": "Command mastery", "icon": "⌨", "level": "beginner", "lessons": [ { "id": "3.1", "title": "Find any command fast", "objective": "Use help, doctor and status to discover what exists before guessing.", "minutes": 7, "commands": [ "help", "doctor", "status" ], "blocks": [ { "type": "text", "text": "`help` groups every registered command by the module that owns them." }, { "type": "cmd", "text": "help" }, { "type": "cmd", "text": "help webdav-push" }, { "type": "tip", "text": "`doctor` shows module requirements — the fastest way to explain a command that is listed but not working." } ], "exercise": { "instruction": "Run `doctor` and read its severity ranking.", "accept": [ "doctor", "help", "status" ], "check": { "type": "command" }, "hint": "Type: doctor" }, "quiz": { "q": "Which command shows usage for one command?", "options": [ "help ", "status", "ls" ], "answer": 0 }, "sources": [ "modules/core/module-system.js", "modules/core/module-manager.js" ] }, { "id": "3.2", "title": "Pipes, grep, sed, tail", "objective": "Combine commands and understand the two semantics that bite: per-line sed and tail -f deltas.", "minutes": 12, "commands": [ "grep", "sed", "tail", "sort", "head" ], "blocks": [ { "type": "text", "text": "Pipes feed one command into the next. `grep` filters lines, `sed` substitutes text, `tail` prints the end of a file." }, { "type": "cmd", "text": "grep hello hello.txt" }, { "type": "warn", "text": "`sed s/x/y/` substitutes the first match per LINE, not per file. `sed -i` overwrites the file immediately — checkpoint first (`checkpoint before-sed`). Pipes are partial in this build: `ls | grep x` may print the unfiltered listing; use `grep pattern file`." }, { "type": "text", "text": "`tail -f` is interactive and stops with Ctrl+C. AI-initiated commands get a bounded read instead." }, { "type": "cmd", "text": "tail hello.txt" } ], "exercise": { "instruction": "Search a file for a word (create `hello.txt` with `edit` if needed).", "accept": [ "grep hello hello.txt", "grep * hello.txt", "grep hello *" ], "check": { "type": "command" }, "hint": "Type: grep hello hello.txt" }, "quiz": { "q": "`sed s/a/b/` replaces…", "options": [ "every match in the file", "the first match on each line", "only the last line" ], "answer": 1 }, "sources": [ "modules/core/module-fs.js", "modules/ext/shell.js", "modules/core/terminal.js" ] } ] }