LPI 010-160 Practice Test 84
Question 830
An administrator uses vi to edit a script on a minimal Linux system. Select TWO statements that together form an appropriate implementation and validation plan.
- Use `:q!` expecting unsaved edits to be kept.
- Assume pressing `i` in a terminal outside vi edits a file.
- The edited file persists on disk after vi exits.
- Enter insert mode with `i`, return with Esc and use `:wq` to write and quit.
- Treat `dd` as vi's save-and-exit command.
Explanation
Correct Answers
C:The edited file persists on disk after vi exits. This provides direct evidence of the intended vi insert mode and write quit behavior.
D:Enter insert mode with `i`, return with Esc and use `:wq` to write and quit. This is the actual implementation for vi insert mode and write quit.
Incorrect Answers
A:Use `:q!` expecting unsaved edits to be kept. This does not contribute a sound implementation or validation step for vi insert mode and write quit. Typing text in command mode can trigger actions rather than insert characters.
B:Assume pressing `i` in a terminal outside vi edits a file. This does not contribute a sound implementation or validation step for vi insert mode and write quit. Typing text in command mode can trigger actions rather than insert characters.
E:Treat `dd` as vi's save-and-exit command. This does not contribute a sound implementation or validation step for vi insert mode and write quit. Typing text in command mode can trigger actions rather than insert characters.
Question 831
A student needs the manual entry for the `ls` utility. Select TWO statements that together form an appropriate implementation and validation plan.
- Run `mkdir ls` and expect manual text.
- Open `top` to search the manual index.
- The manual shows a synopsis and option descriptions for the named command.
- Use `ls -a` as complete documentation for every option.
- Run `man ls` to open the appropriate manual page.
Explanation
Correct Answers
C:The manual shows a synopsis and option descriptions for the named command. This provides direct evidence of the intended man pages and sections behavior.
E:Run `man ls` to open the appropriate manual page. This is the actual implementation for man pages and sections.
Incorrect Answers
A:Run `mkdir ls` and expect manual text. This does not contribute a sound implementation or validation step for man pages and sections. Using a process monitor does not display the command's manual.
B:Open `top` to search the manual index. This does not contribute a sound implementation or validation step for man pages and sections. Using a process monitor does not display the command's manual.
D:Use `ls -a` as complete documentation for every option. This does not contribute a sound implementation or validation step for man pages and sections. Using a process monitor does not display the command's manual.
Question 832
A lab chooses openSUSE for a Linux workstation and needs an appropriate software-management approach. Select TWO statements that together form an appropriate implementation and validation plan.
- Install unsigned Debian packages as the native SUSE repository format.
- The selected system's package-management commands and repositories correspond to its SUSE variant.
- Assume openSUSE is a Windows kernel implementation.
- Recognize openSUSE and SUSE as related Linux distributions with their supported RPM-based package tooling.
- Use Ubuntu LTS release dates as SUSE vendor support commitments.
Explanation
Correct Answers
B:The selected system's package-management commands and repositories correspond to its SUSE variant. This provides direct evidence of the intended SUSE and openSUSE distributions behavior.
D:Recognize openSUSE and SUSE as related Linux distributions with their supported RPM-based package tooling. This is the actual implementation for SUSE and openSUSE distributions.
Incorrect Answers
A:Install unsigned Debian packages as the native SUSE repository format. This does not contribute a sound implementation or validation step for SUSE and openSUSE distributions. Treating openSUSE and SUSE Enterprise as identical support contracts creates lifecycle mistakes.
C:Assume openSUSE is a Windows kernel implementation. This does not contribute a sound implementation or validation step for SUSE and openSUSE distributions. Treating openSUSE and SUSE Enterprise as identical support contracts creates lifecycle mistakes.
E:Use Ubuntu LTS release dates as SUSE vendor support commitments. This does not contribute a sound implementation or validation step for SUSE and openSUSE distributions. Treating openSUSE and SUSE Enterprise as identical support contracts creates lifecycle mistakes.
Question 833
A script must assign a path string to `target` without launching a separate command. Select TWO statements that together form an appropriate implementation and validation plan.
- Expansion of the variable returns the intended assigned value.
- Use `count = 3` as an equivalent Bash assignment.
- Use `==` as the Bash scalar assignment operator.
- Place the variable name after `export -unset` expecting automatic assignment.
- Write Bash scalar assignments without spaces around `=`, such as `count=3`.
Explanation
Correct Answers
A:Expansion of the variable returns the intended assigned value. This provides direct evidence of the intended Bash variable assignment syntax behavior.
E:Write Bash scalar assignments without spaces around `=`, such as `count=3`. This is the actual implementation for Bash variable assignment syntax.
Incorrect Answers
B:Use `count = 3` as an equivalent Bash assignment. This does not contribute a sound implementation or validation step for Bash variable assignment syntax. Incorrect assignment syntax can attempt to run a command named after the variable.
C:Use `==` as the Bash scalar assignment operator. This does not contribute a sound implementation or validation step for Bash variable assignment syntax. Incorrect assignment syntax can attempt to run a command named after the variable.
D:Place the variable name after `export -unset` expecting automatic assignment. This does not contribute a sound implementation or validation step for Bash variable assignment syntax. Incorrect assignment syntax can attempt to run a command named after the variable.
Question 834
A hardware diagnostic script reads attributes exposed by kernel subsystems. Select TWO statements that together form an appropriate implementation and validation plan.
- Inspect `/sys` for supported sysfs device attributes.
- The queried device or subsystem attributes reflect the active kernel state.
- Treat `/sys` as the default place for user photos.
- Assume `/sys` contains only compressed backups.
- Use `/dev/null` as a device attribute browser.
Explanation
Correct Answers
A:Inspect `/sys` for supported sysfs device attributes. This is the actual implementation for /sys device and kernel interfaces.
B:The queried device or subsystem attributes reflect the active kernel state. This provides direct evidence of the intended /sys device and kernel interfaces behavior.
Incorrect Answers
C:Treat `/sys` as the default place for user photos. This does not contribute a sound implementation or validation step for /sys device and kernel interfaces. Mistaking sysfs for a persistent user-data directory can corrupt an investigation.
D:Assume `/sys` contains only compressed backups. This does not contribute a sound implementation or validation step for /sys device and kernel interfaces. Mistaking sysfs for a persistent user-data directory can corrupt an investigation.
E:Use `/dev/null` as a device attribute browser. This does not contribute a sound implementation or validation step for /sys device and kernel interfaces. Mistaking sysfs for a persistent user-data directory can corrupt an investigation.
Question 835
A student wants to see all `.txt` files using filename pattern expansion. Select TWO statements that together form an appropriate implementation and validation plan.
- Assume a quoted asterisk always matches every filename.
- Replace all wildcard patterns with regular expression anchors.
- Treat a glob as a command executable rather than an argument.
- Use `*.txt` unquoted for matching filenames and quote it when literal text is intended.
- The unquoted glob expands to matching filenames while the quoted pattern remains literal.
Explanation
Correct Answers
D:Use `*.txt` unquoted for matching filenames and quote it when literal text is intended. This is the actual implementation for Globbing versus literal pattern.
E:The unquoted glob expands to matching filenames while the quoted pattern remains literal. This provides direct evidence of the intended Globbing versus literal pattern behavior.
Incorrect Answers
A:Assume a quoted asterisk always matches every filename. This does not contribute a sound implementation or validation step for Globbing versus literal pattern. Passing the wrong quoted form can make a command use a literal asterisk as a pathname.
B:Replace all wildcard patterns with regular expression anchors. This does not contribute a sound implementation or validation step for Globbing versus literal pattern. Passing the wrong quoted form can make a command use a literal asterisk as a pathname.
C:Treat a glob as a command executable rather than an argument. This does not contribute a sound implementation or validation step for Globbing versus literal pattern. Passing the wrong quoted form can make a command use a literal asterisk as a pathname.
Question 836
A script file must state that Bash should interpret its command lines. Select TWO statements that together form an appropriate implementation and validation plan.
- Put a Bash comment after the last line and expect it to select the interpreter.
- Direct script execution selects the indicated interpreter.
- Use `/etc/passwd` as the interpreter path.
- Put `#/bin/bash` without `!` and assume it is a shebang.
- Put `#!/bin/bash` on the first line of an executable Bash script where that interpreter is available.
Explanation
Correct Answers
B:Direct script execution selects the indicated interpreter. This provides direct evidence of the intended Shebang shell interpreter behavior.
E:Put `#!/bin/bash` on the first line of an executable Bash script where that interpreter is available. This is the actual implementation for Shebang shell interpreter.
Incorrect Answers
A:Put a Bash comment after the last line and expect it to select the interpreter. This does not contribute a sound implementation or validation step for Shebang shell interpreter. Without a suitable interpreter or execution method, a script may not run as intended.
C:Use `/etc/passwd` as the interpreter path. This does not contribute a sound implementation or validation step for Shebang shell interpreter. Without a suitable interpreter or execution method, a script may not run as intended.
D:Put `#/bin/bash` without `!` and assume it is a shebang. This does not contribute a sound implementation or validation step for Shebang shell interpreter. Without a suitable interpreter or execution method, a script may not run as intended.
Question 837
A student needs a quick filename search for an indexed configuration file. Select TWO statements that together form an appropriate implementation and validation plan.
- Assume locate always searches live disk bytes immediately.
- Run `grep filename` without specifying searchable files.
- The command returns matching paths from its filename database.
- Use `passwd filename` to update the index.
- Use `locate filename` after ensuring its filename index is available and updated.
Explanation
Correct Answers
C:The command returns matching paths from its filename database. This provides direct evidence of the intended locate database lookup behavior.
E:Use `locate filename` after ensuring its filename index is available and updated. This is the actual implementation for locate database lookup.
Incorrect Answers
A:Assume locate always searches live disk bytes immediately. This does not contribute a sound implementation or validation step for locate database lookup. Recently created files may be missing until the index is refreshed.
B:Run `grep filename` without specifying searchable files. This does not contribute a sound implementation or validation step for locate database lookup. Recently created files may be missing until the index is refreshed.
D:Use `passwd filename` to update the index. This does not contribute a sound implementation or validation step for locate database lookup. Recently created files may be missing until the index is refreshed.
Question 838
A new user repeats commands in a Linux terminal and wants to inspect previous entries. Select TWO statements that together form an appropriate implementation and validation plan.
- Run `rm -rf` to display the command history.
- The intended earlier command appears in the interactive shell history.
- Expect every shell session to persist identical history instantly.
- Treat the browser cache as Bash command history.
- Use the shell history facility to inspect and reuse prior commands safely.
Explanation
Correct Answers
B:The intended earlier command appears in the interactive shell history. This provides direct evidence of the intended Terminal access and shell history behavior.
E:Use the shell history facility to inspect and reuse prior commands safely. This is the actual implementation for Terminal access and shell history.
Incorrect Answers
A:Run `rm -rf` to display the command history. This does not contribute a sound implementation or validation step for Terminal access and shell history. Mistaking command history for permanent secure audit storage gives incomplete evidence.
C:Expect every shell session to persist identical history instantly. This does not contribute a sound implementation or validation step for Terminal access and shell history. Mistaking command history for permanent secure audit storage gives incomplete evidence.
D:Treat the browser cache as Bash command history. This does not contribute a sound implementation or validation step for Terminal access and shell history. Mistaking command history for permanent secure audit storage gives incomplete evidence.
Question 839
A CSV export needs a fast count of newline-delimited records. Select TWO statements that together form an appropriate implementation and validation plan.
- Use `sort` alone as a numerical line-count tool.
- The output reports the number of newline terminators in the input.
- Run `wc -l file` and interpret its newline-count semantics.
- Run `cat` and assume it reports line totals.
- Use `wc -c` to count lines.
Explanation
Correct Answers
B:The output reports the number of newline terminators in the input. This provides direct evidence of the intended wc line counting behavior.
C:Run `wc -l file` and interpret its newline-count semantics. This is the actual implementation for wc line counting.
Incorrect Answers
A:Use `sort` alone as a numerical line-count tool. This does not contribute a sound implementation or validation step for wc line counting. Using word count can misrepresent a line-oriented record count.
D:Run `cat` and assume it reports line totals. This does not contribute a sound implementation or validation step for wc line counting. Using word count can misrepresent a line-oriented record count.
E:Use `wc -c` to count lines. This does not contribute a sound implementation or validation step for wc line counting. Using word count can misrepresent a line-oriented record count.
Question 840
A background command is still running and an operator wants its process identifier. Select THREE statements that together form an appropriate implementation and validation plan.
- Run `free` to list all process command lines.
- Use `touch` to obtain the PID list.
- Expect `ls -a` to show active process state.
- Run `ps` with suitable options for the relevant process set.
- `ps` provides a snapshot of processes, not continuously updated interactive monitoring.
- The listing includes process IDs and command information.
Explanation
Correct Answers
D:Run `ps` with suitable options for the relevant process set. This is the actual implementation for ps process listing.
E:`ps` provides a snapshot of processes, not continuously updated interactive monitoring. This is the governing technical reason for the chosen solution.
F:The listing includes process IDs and command information. This provides direct evidence of the intended ps process listing behavior.
Incorrect Answers
A:Run `free` to list all process command lines. This does not contribute a sound implementation or validation step for ps process listing. Reading disk capacity cannot identify all running processes.
B:Use `touch` to obtain the PID list. This does not contribute a sound implementation or validation step for ps process listing. Reading disk capacity cannot identify all running processes.
C:Expect `ls -a` to show active process state. This does not contribute a sound implementation or validation step for ps process listing. Reading disk capacity cannot identify all running processes.