LPI 010-160 Practice Test 81
Question 800
A trainee wants to list local listening TCP sockets on Linux. A check then reveals: Checking only IP assignment does not prove an application is listening. Which targeted correction BEST restores the required behavior?
- Run `route` to list process socket states.
- Inspect sockets with ss and then verify network filtering.
- Use `ip addr show` expecting all listening TCP port details.
- Test DNS answers separately from ping or routing.
Explanation
Correct Answer
B:Inspect sockets with ss and then verify network filtering. This repairs ss listening sockets and should be checked by seeing that the service's TCP listening socket appears with the intended local address.
Incorrect Answers
A:Run `route` to list process socket states. This does not remedy the diagnosed ss listening sockets failure; a listening socket is necessary for incoming TCP service connections but firewall routing may also matter.
C:Use `ip addr show` expecting all listening TCP port details. This does not remedy the diagnosed ss listening sockets failure; a listening socket is necessary for incoming TCP service connections but firewall routing may also matter.
D:Test DNS answers separately from ping or routing. This is a remedy for host DNS name lookup, not the symptom in this ss listening sockets case. Checking only IP assignment does not prove an application is listening.
Question 801
A shell script stores a filename in variable `report` and needs to display it. A check then reveals: Printing the unexpanded identifier does not display its value. Which targeted correction BEST restores the required behavior?
- Type `echo course` and expect it to expand the variable.
- Inspect PATH and add only a trusted executable directory when necessary.
- Reference the assigned variable using expansion syntax.
- Use `echo %course%` as Bash parameter expansion.
Explanation
Correct Answer
C:Reference the assigned variable using expansion syntax. This repairs echo and shell variables and should be checked by seeing that the printed output reflects the variable's stored value.
Incorrect Answers
A:Type `echo course` and expect it to expand the variable. This does not remedy the diagnosed echo and shell variables failure; unquoted variable names in an echo command are literal text, while `$name` expands a shell parameter.
B:Inspect PATH and add only a trusted executable directory when necessary. This is a remedy for PATH and command discovery, not the symptom in this echo and shell variables case. Printing the unexpanded identifier does not display its value.
D:Use `echo %course%` as Bash parameter expansion. This does not remedy the diagnosed echo and shell variables failure; unquoted variable names in an echo command are literal text, while `$name` expands a shell parameter.
Question 802
An open-source project needs suitable terms for manuals and separately for program code. A check then reveals: Using arbitrary content terms for software can leave code-specific rights ambiguous. Which targeted correction BEST restores the required behavior?
- Treat an unlicensed photograph as automatically public domain.
- Choose explicit compatible licenses separately for creative content and software.
- Assume CC BY-NC permits every possible commercial reuse.
- Identify the relevant organization's definition when discussing software freedoms or open-source approval.
Explanation
Correct Answer
B:Choose explicit compatible licenses separately for creative content and software. This repairs Creative Commons and software licensing and should be checked by seeing that documentation and code carry clear licenses appropriate to their materials.
Incorrect Answers
A:Treat an unlicensed photograph as automatically public domain. This does not remedy the diagnosed Creative Commons and software licensing failure; creative Commons licenses are frequently used for creative works whereas software licenses address source-code distribution.
C:Assume CC BY-NC permits every possible commercial reuse. This does not remedy the diagnosed Creative Commons and software licensing failure; creative Commons licenses are frequently used for creative works whereas software licenses address source-code distribution.
D:Identify the relevant organization's definition when discussing software freedoms or open-source approval. This is a remedy for FSF versus OSI organizations, not the symptom in this Creative Commons and software licensing case. Using arbitrary content terms for software can leave code-specific rights ambiguous.
Question 803
A report generator must place a command's output inside a message. A check then reveals: Writing a command name as a string does not execute it. Which targeted correction BEST restores the required behavior?
- Iterate over a glob and quote the loop variable when passed to commands.
- Use `$?` to capture stdout rather than an exit status.
- Set `stamp='date'` expecting the command's current output.
- Use command substitution for computed shell values.
Explanation
Correct Answer
D:Use command substitution for computed shell values. This repairs Command substitution in scripts and should be checked by seeing that the variable contains the command's stdout value.
Incorrect Answers
A:Iterate over a glob and quote the loop variable when passed to commands. This is a remedy for Loop over matching filenames, not the symptom in this Command substitution in scripts case. Writing a command name as a string does not execute it.
B:Use `$?` to capture stdout rather than an exit status. This does not remedy the diagnosed Command substitution in scripts failure; `$()` substitutes a command's output into the surrounding command context.
C:Set `stamp='date'` expecting the command's current output. This does not remedy the diagnosed Command substitution in scripts failure; `$()` substitutes a command's output into the surrounding command context.
Question 804
A shell trainee practices safe removal of one regular file. A check then reveals: Noninteractive deletion can remove the wrong file without prompting. Which targeted correction BEST restores the required behavior?
- Use `rmdir` on a regular text file.
- Move the item after checking whether a destination exists.
- Use interactive removal and verify the exact path.
- Run `rm -f` expecting a prompt for every file.
Explanation
Correct Answer
C:Use interactive removal and verify the exact path. This repairs rm interactive deletion and should be checked by seeing that the shell asks for confirmation and removes the file only when affirmed.
Incorrect Answers
A:Use `rmdir` on a regular text file. This does not remedy the diagnosed rm interactive deletion failure; `rm -i` provides a confirmation prompt; deletion is otherwise not a recycle-bin operation.
B:Move the item after checking whether a destination exists. This is a remedy for mv rename and relocation, not the symptom in this rm interactive deletion case. Noninteractive deletion can remove the wrong file without prompting.
D:Run `rm -f` expecting a prompt for every file. This does not remedy the diagnosed rm interactive deletion failure; `rm -i` provides a confirmation prompt; deletion is otherwise not a recycle-bin operation.
Question 805
An administrator needs to inspect local usernames and login-shell fields. A check then reveals: Treating the `x` placeholder as the user's plaintext password misreads the file. Which targeted correction BEST restores the required behavior?
- Edit `/dev/null` to display local login accounts.
- Assume `/etc/passwd` stores everyone's readable cleartext password.
- Select the session tool matching current versus historical activity.
- Interpret passwd file fields according to the documented format.
Explanation
Correct Answer
D:Interpret passwd file fields according to the documented format. This repairs /etc/passwd public account metadata and should be checked by seeing that entries include colon-separated account metadata without storing cleartext user passwords.
Incorrect Answers
A:Edit `/dev/null` to display local login accounts. This does not remedy the diagnosed /etc/passwd public account metadata failure; `/etc/passwd` holds public local account information; secret password hashes are normally stored elsewhere.
B:Assume `/etc/passwd` stores everyone's readable cleartext password. This does not remedy the diagnosed /etc/passwd public account metadata failure; `/etc/passwd` holds public local account information; secret password hashes are normally stored elsewhere.
C:Select the session tool matching current versus historical activity. This is a remedy for who w and last login activity, not the symptom in this /etc/passwd public account metadata case. Treating the `x` placeholder as the user's plaintext password misreads the file.
Question 806
A class builds a simple repetitive action without duplicating three echo lines. A check then reveals: Omitting the loop terminator or variable expansion changes the expected output. Which targeted correction BEST restores the required behavior?
- Use `for` without `do` and assume it is complete.
- Use `name=value` assignment syntax inside the script.
- Use for-in-do-done syntax with the intended item list.
- Assign a scalar once and expect it to iterate automatically.
Explanation
Correct Answer
C:Use for-in-do-done syntax with the intended item list. This repairs Loop over fixed items and should be checked by seeing that the loop produces one line per supplied item.
Incorrect Answers
A:Use `for` without `do` and assume it is complete. This does not remedy the diagnosed Loop over fixed items failure; a `for` loop assigns successive list items to the loop variable.
B:Use `name=value` assignment syntax inside the script. This is a remedy for Bash variable assignment syntax, not the symptom in this Loop over fixed items case. Omitting the loop terminator or variable expansion changes the expected output.
D:Assign a scalar once and expect it to iterate automatically. This does not remedy the diagnosed Loop over fixed items failure; a `for` loop assigns successive list items to the loop variable.
Question 807
A technician moves a target directory and its relative symbolic links stop resolving. A check then reveals: Repairing permissions alone cannot recover a nonexistent target file. Which targeted correction BEST restores the required behavior?
- Run `chmod 777 link` as a guaranteed way to restore a missing target.
- Check the host's cleanup rules and place durable work elsewhere.
- Correct the link path or restore the referenced target.
- Assume every symbolic link contains a full independent copy of target bytes.
Explanation
Correct Answer
C:Correct the link path or restore the referenced target. This repairs Dangling symbolic links and should be checked by seeing that the repaired link resolves to an existing target pathname.
Incorrect Answers
A:Run `chmod 777 link` as a guaranteed way to restore a missing target. This does not remedy the diagnosed Dangling symbolic links failure; symbolic links can dangle when their targets are removed or relocated.
B:Check the host's cleanup rules and place durable work elsewhere. This is a remedy for /tmp and /var/tmp retention, not the symptom in this Dangling symbolic links case. Repairing permissions alone cannot recover a nonexistent target file.
D:Assume every symbolic link contains a full independent copy of target bytes. This does not remedy the diagnosed Dangling symbolic links failure; symbolic links can dangle when their targets are removed or relocated.
Question 808
A team needs a changing view of process utilization over time. A check then reveals: A single static file listing cannot show evolving CPU usage. Which targeted correction BEST restores the required behavior?
- Read appropriate `/proc` interfaces for transient system state.
- Use `pwd` to monitor current CPU consumption.
- Run `ls -l` expecting CPU usage refresh.
- Monitor the workload with top and inspect the responsible process.
Explanation
Correct Answer
D:Monitor the workload with top and inspect the responsible process. This repairs top interactive process monitor and should be checked by seeing that process CPU and memory columns update during observation.
Incorrect Answers
A:Read appropriate `/proc` interfaces for transient system state. This is a remedy for /proc virtual process information, not the symptom in this top interactive process monitor case. A single static file listing cannot show evolving CPU usage.
B:Use `pwd` to monitor current CPU consumption. This does not remedy the diagnosed top interactive process monitor failure; top provides interactive periodically refreshed process information.
C:Run `ls -l` expecting CPU usage refresh. This does not remedy the diagnosed top interactive process monitor failure; top provides interactive periodically refreshed process information.
Question 809
A technician plans a Linux host and must distinguish processor and RAM roles. A check then reveals: Replacing storage alone does not necessarily remedy insufficient working memory. Which targeted correction BEST restores the required behavior?
- Use a monitor resolution setting to increase CPU cores.
- Treat an SSD as equivalent to RAM in speed and function.
- Measure the relevant hardware resource before upgrading.
- Verify device identities before any destructive operation.
Explanation
Correct Answer
C:Measure the relevant hardware resource before upgrading. This repairs CPU and RAM responsibilities and should be checked by seeing that monitoring shows processor utilization and memory availability separately.
Incorrect Answers
A:Use a monitor resolution setting to increase CPU cores. This does not remedy the diagnosed CPU and RAM responsibilities failure; cPU executes instructions while RAM holds data and program state in use.
B:Treat an SSD as equivalent to RAM in speed and function. This does not remedy the diagnosed CPU and RAM responsibilities failure; cPU executes instructions while RAM holds data and program state in use.
D:Verify device identities before any destructive operation. This is a remedy for Linux block devices and partitions, not the symptom in this CPU and RAM responsibilities case. Replacing storage alone does not necessarily remedy insufficient working memory.
Question 810
A shell prompt is deep inside a project and the operator wants a home-relative path. A check then reveals: Confusing home with `/` changes the destination. Which targeted correction BEST restores the required behavior?
- Treat `~` as the current directory marker.
- Use `cd /` as the user's home directory on every system.
- Navigate to the user's home explicitly.
- Inspect the path with `pwd` before performing relative operations.
Explanation
Correct Answer
C:Navigate to the user's home explicitly. This repairs Home directory shorthand and should be checked by seeing that `pwd` shows the current user's configured home directory.
Incorrect Answers
A:Treat `~` as the current directory marker. This does not remedy the diagnosed Home directory shorthand failure; shell tilde expansion and bare `cd` provide convenient home-directory navigation.
B:Use `cd /` as the user's home directory on every system. This does not remedy the diagnosed Home directory shorthand failure; shell tilde expansion and bare `cd` provide convenient home-directory navigation.
D:Inspect the path with `pwd` before performing relative operations. This is a remedy for pwd current directory, not the symptom in this Home directory shorthand case. Confusing home with `/` changes the destination.