CSCD240-S26-L07
Lecture 7. I/O redirection, aliases, source, .bashrc, env
Delivered 2026-04-08
Key topics: ["alias","source","bash","history","echo",">", ">>","2>","PATH"]
Authority mappings
Exam questions that cite this lecture
- CSCD240-E1-A-Q03 io-redirection Cause executable grader to run with stdout redirected to report.txt. pwd is part of PATH.
- CSCD240-E1-A-Q15 env-path Add /opt/tools/bin to PATH for the current shell.
- CSCD240-E1-A-Q25 alias Create alias ll for long listing with human-readable file sizes.
- CSCD240-E1-A-Q31 quoting var="Stu Steiner". A) echo "Hello $var" B) echo 'Hello $var'. Explain difference and output.
- CSCD240-E1-A-Q35 redir-stderr Send only stderr of "scan /etc/shadow" to errors.log; keep stdout on terminal.
- CSCD240-E1-A-Q36 redir-merge Send BOTH stdout and stderr of build.sh into build.log.
- CSCD240-E1-A-Q39 assignment A) FOO=bar B) FOO = bar. Which is valid? One-sentence explanation of the error.
- CSCD240-E1-A-Q40 evaluation-order sort data.txt > data.txt — what happens to data.txt and why?
- CSCD240-E1-A-Q46 env Display every environment variable currently defined in your shell.
- CSCD240-E1-B-Q15 redir Send only stderr of "scan /etc/shadow" to errors.log; leave stdout on terminal.
- CSCD240-E1-B-Q16 redir Send BOTH stdout and stderr of build.sh to build.log.
- CSCD240-E1-B-Q17 evaluation-order sort auth.log > auth.log — what happens, one-sentence why?
- CSCD240-E1-B-Q39 quoting var="Red Team". A) echo "Go $var" B) echo 'Go $var'. Output + explain difference.
- CSCD240-E1-B-Q40 assignment A) FOO=bar B) FOO = bar. Which valid; explain error.
- CSCD240-E1-B-Q42 env-path Append /opt/tools/bin to PATH for current shell.
- CSCD240-E1-B-Q43 shell-config Reload ~/.bashrc without opening a new terminal.
- CSCD240-E1-B-Q44 alias Alias lsm = ls -lah --sort=time.
- CSCD240-E1-C-Q05 redir Which redirection sends only stderr of a command to a file err.log?
- CSCD240-E1-C-Q09 quoting NAME=ops. echo '$NAME' prints what?
- CSCD240-E1-C-Q14 shell-config Reload ~/.bashrc in current shell without opening new terminal?
- CSCD240-E1-C-Q20 env Which single command displays the current value of PATH?
- CSCD240-E1-C-Q32 env-path Append /opt/ir/bin to PATH for current shell only.
- CSCD240-E1-C-Q34 alias Define alias mvi for mv -i (interactive prompt).
- CSCD240-E1-C-Q38 shell-compound Write the separator so both commands run regardless of success, then example date and hostname.
- CSCD240-E1-C-Q39 redir-merge Send BOTH stdout and stderr of make into merged.log (full example).
- CSCD240-E1-C-Q40 evaluation-order sort /var/log/audit.log > /var/log/audit.log — state and why.
- CSCD240-E1-C-Q46 malicious-alias .bashrc contains alias ls='rm -rf'. Consequence if planted and user opens a new shell?
- CSCD240-E1-C-Q48 bash-syntax ENV_VAR = "production" produced "ENV_VAR: command not found". Error + correction.