Original course questions with explained answers. This assessment is for learning; it does not predict certification exam results.
Free sample questions with explanations
Try these sample questions without an account. Choose your answer, then open the explanation. Sign in below to take the full scored test and save your result.
1. Which preserves a name with spaces as one argument?
- "$name"
- An unquoted expansion everywhere
- Deleting spaces
Show answer and explanation for question 1
Correct answer: A. "$name"
Quoting preserves the intended argument.
2. Why use a fixed printf format?
- To change file ownership
- To keep input as data rather than format instructions
- To grant root access
Show answer and explanation for question 2
Correct answer: B. To keep input as data rather than format instructions
Data should not define the format string.
3. What should a missing input file produce?
- A normal zero-row success
- A silent deletion
- An explicit failure
Show answer and explanation for question 3
Correct answer: C. An explicit failure
Missing input is not the same as an empty valid input.
4. The input directory contains spaces. Which expansion passes its path as one argument while allowing a .txt glob?
- "$input"/*.txt
- "$input/*.txt"
- $input/*.txt
Show answer and explanation for question 4
Correct answer: A. "$input"/*.txt
Quote the variable expansion to preserve the directory argument, leaving the glob outside those quotes. Fully quoting the pattern makes the asterisk literal; leaving the variable unquoted can split its value.
5. Another process creates the output after the preflight existence check. What protects its contents?
- The earlier check permanently reserves the path.
- The final exclusive publication operation refuses the existing target.
- The collector may overwrite it because the check previously passed.
Show answer and explanation for question 5
Correct answer: B. The final exclusive publication operation refuses the existing target.
Preflight checks can race. The final GNU ln -T operation provides the no-overwrite boundary. Publication failure must remain a failure rather than falling back to an overwriting copy.
Sign in to take this free practice test and save your result.
Sign in