performance
medium
Apply
redir-stderr
2 points
Question 35. CSCD240-E1-A
Send only stderr of "scan /etc/shadow" to errors.log; keep stdout on terminal.
Work the drill
Answer on paper or in a terminal before revealing the ideal answer.
Ideal answer
scan /etc/shadow 2> errors.log
Misconception bank
Each row below is a plausible wrong answer, the thinking that produces it, and the remedy that corrects the misconception. These are the foundation of the multiple-choice framing and the targeted feedback a student receives after answering.
scan /etc/shadow > errors.log
Misconception. Redirects stdout instead of stderr.
Remedy. Teach fd numbers and their operators.
scan /etc/shadow &> errors.log
Misconception. Redirects BOTH, not just stderr.
Remedy. &> is for merge; 2> for stderr-only.
Authority mappings
Hover any chip for the mapping justification; click to open the authority record.
DCWF roles:
IT-451 System Administrator
DCWF tasks:
T0498
KU outcomes:
CD-BSP-O1
KU topics:
CD-BSP-T8i
Course-artifact links
Lectures
- CSCD240-S26-L07. I/O redirection, aliases, source, .bashrc, env
Lab questions
- CSCD240-S26-LAB4: Redirect ls /nonexistent errors to err.log using 2>.
CTF challenges
- 03 I/O & Pipelines: Catch Only Errors
- 03 I/O & Pipelines: Stream Number 2
- 03 I/O & Pipelines: The Error Stream