WGU D796 Unix and Linux Performance Assessment (RQN1) |
Complete PA Guide, Bash Scripts, Flowcharts, Panopto Video
Demonstration & Detailed Explanations | 2026/2027 Updated
This assessment evaluates command-line mastery of the Unix/Linux environment as required by the WGU D796
performance assessment. It emphasizes shell interpretation, stream redirection, pipeline semantics,
process/environment interaction, and precise diagnostic reasoning using core utilities, aligned to the 2026/2027
RQN1 rubric. It contains 145 multiple-choice questions, each with four distractors and a fully worked rationale
that explains why the keyed answer is correct. Content is organized into 12 focused sections: Unix/Linux
Fundamentals and Command-Line Environment, File System Navigation, Permissions, and Management, Shell
Scripting and Bash Automation, Process Management and Job Control, User and Group Administration,
Networking Configuration and Troubleshooting, System Monitoring and Performance Analysis, Package
Management and Software Installation, Storage, Disk Management, and File Systems, Security, Access Control,
and System Hardening, Performance Assessment Tasks and Flowchart Design, Panopto Video Demonstration and
Documentation. Targeted learning outcomes include: Analyze shell parsing, quoting, and expansion rules to
predict command behavior in complex pipelines; Differentiate stdout/stderr streams and apply redirection, tee,
and pipefail semantics correctly; Interpret process, environment, and permission interactions using ps, env, find,
and related utilities. Every item has been reviewed for clinical accuracy, current guidelines, and clarity so that
students can study with confidence and self-correct as they work through the bank. Use it as a high-yield review
Section 1: Unix/Linux Fundamentals and Command-Line Environment (Questions 1-13)
1 In bash, what does `echo "$HOME" '$HOME'` output when HOME=/root?
A) /root /root
B) /root $HOME
C) $HOME $HOME
D) /root '$HOME'
Answer: B
Rationale: Double quotes permit parameter expansion, so "$HOME" becomes
/root; single quotes suppress expansion, so '$HOME' is literal. Options A, C,
and D misapply quoting rules (A expands both, C expands neither, D retains
literal quotes).
2 Which redirection captures both stdout and stderr to file.log while still
showing output?
A) cmd > file.log 2>&1
B) cmd 2>&1 | tee file.log
C) cmd &> file.log
D) cmd 2> file.log 1>&2
Answer: B
,Rationale: Only `2>&1 | tee file.log` merges stderr into stdout and displays via
tee while writing the file. A and C redirect without displaying; D sends stdout
to stderr's target, not to file.log.
3 Given `set -o pipefail`, pipeline `grep x f | sort` returns nonzero when:
A) Only sort fails
B) Any component fails
C) Only grep fails
D) The last command fails
Answer: B
Rationale: pipefail makes the pipeline's exit status the rightmost nonzero status,
so failure of any component propagates. Without pipefail only the last
command's status matters (D). A and C describe partial, incorrect conditions.
4 Why does `find . -name *.log` behave unexpectedly in bash?
A) find ignores -name globs
B) Bash expands *.log before find runs
C) find requires -iname for globs
D) The dot path disables globbing
Answer: B
Rationale: Unquoted *.log is pathname-expanded by the shell in the current
directory before find receives arguments, altering the expression. Quoting
('*.log') defers expansion to find. The other options misstate find semantics.
5 A script's shebang is `#!/usr/bin/env bash`. What is the primary advantage?
A) It forces POSIX sh mode
B) It locates bash via PATH
C) It enables set -e by default
D) It bypasses kernel exec limits
Answer: B
Rationale: `#!/usr/bin/env bash` resolves bash through PATH, improving
portability across systems where bash is not at /bin/bash. It does not enable
POSIX mode, set -e, or bypass exec limits.
6 Which command shows only PID and command name for all processes,
sorted by PID?
,A) ps -eo pid,comm --sort=pid
B) ps aux | sort -k2
C) top -b -n1 | sort
D) pgrep -a . | sort -n
Answer: A
Rationale: `ps -eo pid,comm --sort=pid` selects only PID and command name
and sorts numerically by PID. B and C include extra columns and mis-sort; D
lists matching processes but not a full, column-controlled listing.
7 Executing `./script.sh` returns 'Permission denied' though `bash script.sh`
works. Best diagnosis?
A) Missing shebang line
B) No execute bit on file
C) PATH lacks current directory
D) Script uses CRLF line endings
Answer: B
Rationale: Direct execution requires the execute permission bit; invoking via
bash reads the file without needing it. A shebang, PATH, and CRLF issues
would produce different errors (bad interpreter or command-not-found).
8 After `export FOO=bar` in a shell, a child process inherits FOO because:
A) export writes to /etc/environment
B) Exported vars enter the environment block
C) Child shells re-source .bashrc
D) FOO becomes a shell function
Answer: B
Rationale: export marks a variable for inclusion in the process environment,
which is copied to children at fork/exec. It does not modify /etc/environment,
re-source rc files, or create functions.
9 Which accurately contrasts a shell builtin like `cd` with an external binary?
A) cd forks a subshell to change directory
B) Builtins run in the current shell process
C) External binaries cannot alter env vars
D) Builtins always take precedence via PATH
Answer: B
, Rationale: Builtins such as cd execute within the current shell, so state changes
persist; external commands run as child processes. cd cannot fork (A),
externals can alter their own env (C), and builtins are not resolved via PATH
(D).
10 Command `ls /nonexistent 2>/dev/null 1>&2` prints nothing. Why?
A) stderr was discarded, then stdout sent to discarded stderr
B) stdout was discarded, stderr to terminal
C) Both streams merged to terminal
D) ls produced no error output
Answer: A
Rationale: Order matters: `2>/dev/null` discards stderr, then `1>&2` duplicates
stdout onto the now-discarded stderr, so the error is hidden. B, C, and D
misread the sequential redirection semantics.
11 In a Bash script, which construct correctly tests whether a file exists and is
a regular file, failing safely if the path is empty?
A) if [ -f "$file" ]; then ...; fi
B) if [ -e "$file" ]; then ...; fi
C) if test -f $file; then ...; fi
D) if [[ -f $file ]]; then ...; fi
Answer: A
Rationale: The -f test returns true only for regular files, and quoting "$file"
prevents word splitting or unary-operator errors when the variable is empty or
contains spaces. -e matches any file type (directories, devices), unquoted $file
breaks on empty/whitespace, and [[ -f $file ]] still fails if $file is empty because
the test becomes [[ -f ]] which is a syntax error.
12 A script runs `find /var/log -type f -name '*.log' -mtime +7 -exec gzip {} \;`.
What does the `\;` accomplish?
A) It terminates the -exec command, invoking gzip once per matched file.
B) It terminates the -exec command, invoking gzip once with all matched
files.
C) It escapes the semicolon so the shell does not treat it as a command
separator.
D) It passes a literal semicolon as an argument to gzip.
Complete PA Guide, Bash Scripts, Flowcharts, Panopto Video
Demonstration & Detailed Explanations | 2026/2027 Updated
This assessment evaluates command-line mastery of the Unix/Linux environment as required by the WGU D796
performance assessment. It emphasizes shell interpretation, stream redirection, pipeline semantics,
process/environment interaction, and precise diagnostic reasoning using core utilities, aligned to the 2026/2027
RQN1 rubric. It contains 145 multiple-choice questions, each with four distractors and a fully worked rationale
that explains why the keyed answer is correct. Content is organized into 12 focused sections: Unix/Linux
Fundamentals and Command-Line Environment, File System Navigation, Permissions, and Management, Shell
Scripting and Bash Automation, Process Management and Job Control, User and Group Administration,
Networking Configuration and Troubleshooting, System Monitoring and Performance Analysis, Package
Management and Software Installation, Storage, Disk Management, and File Systems, Security, Access Control,
and System Hardening, Performance Assessment Tasks and Flowchart Design, Panopto Video Demonstration and
Documentation. Targeted learning outcomes include: Analyze shell parsing, quoting, and expansion rules to
predict command behavior in complex pipelines; Differentiate stdout/stderr streams and apply redirection, tee,
and pipefail semantics correctly; Interpret process, environment, and permission interactions using ps, env, find,
and related utilities. Every item has been reviewed for clinical accuracy, current guidelines, and clarity so that
students can study with confidence and self-correct as they work through the bank. Use it as a high-yield review
Section 1: Unix/Linux Fundamentals and Command-Line Environment (Questions 1-13)
1 In bash, what does `echo "$HOME" '$HOME'` output when HOME=/root?
A) /root /root
B) /root $HOME
C) $HOME $HOME
D) /root '$HOME'
Answer: B
Rationale: Double quotes permit parameter expansion, so "$HOME" becomes
/root; single quotes suppress expansion, so '$HOME' is literal. Options A, C,
and D misapply quoting rules (A expands both, C expands neither, D retains
literal quotes).
2 Which redirection captures both stdout and stderr to file.log while still
showing output?
A) cmd > file.log 2>&1
B) cmd 2>&1 | tee file.log
C) cmd &> file.log
D) cmd 2> file.log 1>&2
Answer: B
,Rationale: Only `2>&1 | tee file.log` merges stderr into stdout and displays via
tee while writing the file. A and C redirect without displaying; D sends stdout
to stderr's target, not to file.log.
3 Given `set -o pipefail`, pipeline `grep x f | sort` returns nonzero when:
A) Only sort fails
B) Any component fails
C) Only grep fails
D) The last command fails
Answer: B
Rationale: pipefail makes the pipeline's exit status the rightmost nonzero status,
so failure of any component propagates. Without pipefail only the last
command's status matters (D). A and C describe partial, incorrect conditions.
4 Why does `find . -name *.log` behave unexpectedly in bash?
A) find ignores -name globs
B) Bash expands *.log before find runs
C) find requires -iname for globs
D) The dot path disables globbing
Answer: B
Rationale: Unquoted *.log is pathname-expanded by the shell in the current
directory before find receives arguments, altering the expression. Quoting
('*.log') defers expansion to find. The other options misstate find semantics.
5 A script's shebang is `#!/usr/bin/env bash`. What is the primary advantage?
A) It forces POSIX sh mode
B) It locates bash via PATH
C) It enables set -e by default
D) It bypasses kernel exec limits
Answer: B
Rationale: `#!/usr/bin/env bash` resolves bash through PATH, improving
portability across systems where bash is not at /bin/bash. It does not enable
POSIX mode, set -e, or bypass exec limits.
6 Which command shows only PID and command name for all processes,
sorted by PID?
,A) ps -eo pid,comm --sort=pid
B) ps aux | sort -k2
C) top -b -n1 | sort
D) pgrep -a . | sort -n
Answer: A
Rationale: `ps -eo pid,comm --sort=pid` selects only PID and command name
and sorts numerically by PID. B and C include extra columns and mis-sort; D
lists matching processes but not a full, column-controlled listing.
7 Executing `./script.sh` returns 'Permission denied' though `bash script.sh`
works. Best diagnosis?
A) Missing shebang line
B) No execute bit on file
C) PATH lacks current directory
D) Script uses CRLF line endings
Answer: B
Rationale: Direct execution requires the execute permission bit; invoking via
bash reads the file without needing it. A shebang, PATH, and CRLF issues
would produce different errors (bad interpreter or command-not-found).
8 After `export FOO=bar` in a shell, a child process inherits FOO because:
A) export writes to /etc/environment
B) Exported vars enter the environment block
C) Child shells re-source .bashrc
D) FOO becomes a shell function
Answer: B
Rationale: export marks a variable for inclusion in the process environment,
which is copied to children at fork/exec. It does not modify /etc/environment,
re-source rc files, or create functions.
9 Which accurately contrasts a shell builtin like `cd` with an external binary?
A) cd forks a subshell to change directory
B) Builtins run in the current shell process
C) External binaries cannot alter env vars
D) Builtins always take precedence via PATH
Answer: B
, Rationale: Builtins such as cd execute within the current shell, so state changes
persist; external commands run as child processes. cd cannot fork (A),
externals can alter their own env (C), and builtins are not resolved via PATH
(D).
10 Command `ls /nonexistent 2>/dev/null 1>&2` prints nothing. Why?
A) stderr was discarded, then stdout sent to discarded stderr
B) stdout was discarded, stderr to terminal
C) Both streams merged to terminal
D) ls produced no error output
Answer: A
Rationale: Order matters: `2>/dev/null` discards stderr, then `1>&2` duplicates
stdout onto the now-discarded stderr, so the error is hidden. B, C, and D
misread the sequential redirection semantics.
11 In a Bash script, which construct correctly tests whether a file exists and is
a regular file, failing safely if the path is empty?
A) if [ -f "$file" ]; then ...; fi
B) if [ -e "$file" ]; then ...; fi
C) if test -f $file; then ...; fi
D) if [[ -f $file ]]; then ...; fi
Answer: A
Rationale: The -f test returns true only for regular files, and quoting "$file"
prevents word splitting or unary-operator errors when the variable is empty or
contains spaces. -e matches any file type (directories, devices), unquoted $file
breaks on empty/whitespace, and [[ -f $file ]] still fails if $file is empty because
the test becomes [[ -f ]] which is a syntax error.
12 A script runs `find /var/log -type f -name '*.log' -mtime +7 -exec gzip {} \;`.
What does the `\;` accomplish?
A) It terminates the -exec command, invoking gzip once per matched file.
B) It terminates the -exec command, invoking gzip once with all matched
files.
C) It escapes the semicolon so the shell does not treat it as a command
separator.
D) It passes a literal semicolon as an argument to gzip.