Question 140
While preparing a Linux workstation for training, an operator finds: A beginner prints thousands of lines with cat and cannot inspect earlier output because the terminal scrollback is limited. What ongoing quality or security safeguard is most appropriate?
Explanation
Correct Answer
This safeguard addresses less interactive paging of long output: Use a pager for lengthy diagnostic output rather than repeatedly flooding a terminal with unrestricted command results. The prevented failure mechanism is: A pager such as less allows interactive navigation through long text without emitting the whole file as an uncontrolled screen dump. A control for an unrelated service cannot establish the required protection.
Incorrect Answers
Tar extraction restores archived pathname entries relative to a chosen destination, so the current working directory and archive paths affect where files appear. “List archive contents and use a disposable extraction directory when handling unfamiliar tar files or backups” would remedy that alternative situation, but it would not correct the present issue: a pager such as less allows interactive navigation through long text without emitting the whole file as an uncontrolled screen dump.
“Name the exact unit in reports created with wc and test trailing-newline behavior when exact record counts matter” is the supported response when the wc options count different units: newline-terminated lines, whitespace-delimited words and bytes respectively. Here the decisive response is “Use a pager for lengthy diagnostic output rather than repeatedly flooding a terminal with unrestricted command results”, so that different intervention does not meet the stated requirement.
Head selects leading lines, while tail selects trailing lines from a text stream or file. “Confirm whether a file is appended or rewritten before assuming the last stored lines always represent the newest events” applies to that other condition. The reported evidence is a beginner prints thousands of lines with cat and cannot inspect earlier output because the terminal scrollback is limited; this alternative would address the wrong dependency.