LPI 010-160 Practice Test 77
Question 760
A script author needs to distinguish a command name from its option and path operand. A check then reveals: Treating option flags as pathnames changes the operation. Which targeted correction BEST restores the required behavior?
- Export the variable before starting the dependent process.
- Treat `-l` as a universal shell variable.
- Place command, option and target in the documented order.
- Use `/tmp` as an executable to list itself.
Explanation
Correct Answer
C:Place command, option and target in the documented order. This repairs Bash command and argument structure and should be checked by seeing that the output uses long listing format for the specified directory.
Incorrect Answers
A:Export the variable before starting the dependent process. This is a remedy for Exported environment variables, not the symptom in this Bash command and argument structure case. Treating option flags as pathnames changes the operation.
B:Treat `-l` as a universal shell variable. This does not remedy the diagnosed Bash command and argument structure failure; shell command lines combine a command with options and positional arguments.
D:Use `/tmp` as an executable to list itself. This does not remedy the diagnosed Bash command and argument structure failure; shell command lines combine a command with options and positional arguments.
Question 761
A trainee compares `/etc/passwd` with `/etc/shadow`. A check then reveals: Making shadow data world-readable exposes password hashes for offline attack. Which targeted correction BEST restores the required behavior?
- Assume `/etc/shadow` is the DNS resolver list.
- Put all password hashes into a public web directory.
- Confirm identity and group membership with id.
- Keep shadow permissions restricted and administer it with approved tools.
Explanation
Correct Answer
D:Keep shadow permissions restricted and administer it with approved tools. This repairs /etc/shadow protected credentials and should be checked by seeing that file access restrictions keep sensitive authentication fields from ordinary readers.
Incorrect Answers
A:Assume `/etc/shadow` is the DNS resolver list. This does not remedy the diagnosed /etc/shadow protected credentials failure; shadow password storage separates sensitive credential information from generally readable account metadata.
B:Put all password hashes into a public web directory. This does not remedy the diagnosed /etc/shadow protected credentials failure; shadow password storage separates sensitive credential information from generally readable account metadata.
C:Confirm identity and group membership with id. This is a remedy for id UID and group identity, not the symptom in this /etc/shadow protected credentials case. Making shadow data world-readable exposes password hashes for offline attack.
Question 762
A technician wants to find paths containing a known filename and accepts index freshness limitations. A check then reveals: Recently created files may be missing until the index is refreshed. Which targeted correction BEST restores the required behavior?
- Run `grep filename` without specifying searchable files.
- Inspect the relevant package documentation directory.
- Check the locate index's freshness before relying on results.
- Assume locate always searches live disk bytes immediately.
Explanation
Correct Answer
C:Check the locate index's freshness before relying on results. This repairs locate database lookup and should be checked by seeing that the command returns matching paths from its filename database.
Incorrect Answers
A:Run `grep filename` without specifying searchable files. This does not remedy the diagnosed locate database lookup failure; `locate` searches a prebuilt file-name index rather than necessarily scanning the live filesystem.
B:Inspect the relevant package documentation directory. This is a remedy for /usr/share/doc documentation directory, not the symptom in this locate database lookup case. Recently created files may be missing until the index is refreshed.
D:Assume locate always searches live disk bytes immediately. This does not remedy the diagnosed locate database lookup failure; `locate` searches a prebuilt file-name index rather than necessarily scanning the live filesystem.
Question 763
An administrator needs one privileged command while retaining an attributable user identity. A check then reveals: Lack of sudo permission is not fixed by adding a shell alias alone. Which targeted correction BEST restores the required behavior?
- Request approved sudo rights and invoke only the required administrative operation.
- Run any ordinary command and assume it implicitly becomes root.
- Share the root password with all staff as the first choice.
- Operate with least privilege and elevate only for the task that requires it.
Explanation
Correct Answer
A:Request approved sudo rights and invoke only the required administrative operation. This repairs sudo authorized privilege elevation and should be checked by seeing that the intended privileged action succeeds only for an authorized operator.
Incorrect Answers
B:Run any ordinary command and assume it implicitly becomes root. This does not remedy the diagnosed sudo authorized privilege elevation failure; sudo executes a command with permitted elevated privileges and can enforce policy.
C:Share the root password with all staff as the first choice. This does not remedy the diagnosed sudo authorized privilege elevation failure; sudo executes a command with permitted elevated privileges and can enforce policy.
D:Operate with least privilege and elevate only for the task that requires it. This is a remedy for Root versus ordinary users, not the symptom in this sudo authorized privilege elevation case. Lack of sudo permission is not fixed by adding a shell alias alone.
Question 764
A trainee asks why the shell finds commands in `/usr/bin` without a full pathname. A check then reveals: A command outside PATH may require a qualified path. Which targeted correction BEST restores the required behavior?
- Copy the binary name into the shell prompt without a file.
- Inspect PATH and add only a trusted executable directory when necessary.
- Change `HOME` and assume PATH updates automatically.
- Quote or escape pathnames containing whitespace.
Explanation
Correct Answer
B:Inspect PATH and add only a trusted executable directory when necessary. This repairs PATH and command discovery and should be checked by seeing that the command resolves to the intended executable from a directory on the search path.
Incorrect Answers
A:Copy the binary name into the shell prompt without a file. This does not remedy the diagnosed PATH and command discovery failure; pATH is a colon-separated list of directories the shell searches for command names.
C:Change `HOME` and assume PATH updates automatically. This does not remedy the diagnosed PATH and command discovery failure; pATH is a colon-separated list of directories the shell searches for command names.
D:Quote or escape pathnames containing whitespace. This is a remedy for Escaping spaces in shell paths, not the symptom in this PATH and command discovery case. A command outside PATH may require a qualified path.
Question 765
A report needs lines ordered before duplicate analysis. A check then reveals: Counting lines does not put records in lexical order. Which targeted correction BEST restores the required behavior?
- Apply sort to the intended stream and check locale assumptions.
- Use `wc -l file` to alphabetize rows.
- Connect filtering output to the counting stage.
- Run `grep . file` expecting a sorted result.
Explanation
Correct Answer
A:Apply sort to the intended stream and check locale assumptions. This repairs sort text records and should be checked by seeing that the resulting output is ordered according to the active locale's sort rules.
Incorrect Answers
B:Use `wc -l file` to alphabetize rows. This does not remedy the diagnosed sort text records failure; `sort` orders lines while other tools filter or count them.
C:Connect filtering output to the counting stage. This is a remedy for Pipes connecting commands, not the symptom in this sort text records case. Counting lines does not put records in lexical order.
D:Run `grep . file` expecting a sorted result. This does not remedy the diagnosed sort text records failure; `sort` orders lines while other tools filter or count them.
Question 766
A colon-separated file contains login names and numeric identifiers. A check then reveals: Choosing the wrong field or delimiter yields incorrect values. Which targeted correction BEST restores the required behavior?
- Use `cut -f 0` as the second field index.
- Specify the exact delimiter and one-based field index.
- Choose the line-count option while checking whether the last line has a newline.
- Run `sort` and expect it to select a colon-separated column.
Explanation
Correct Answer
B:Specify the exact delimiter and one-based field index. This repairs cut delimited fields and should be checked by seeing that output contains the requested field instead of full records.
Incorrect Answers
A:Use `cut -f 0` as the second field index. This does not remedy the diagnosed cut delimited fields failure; `cut` selects fields based on the delimiter and field number.
C:Choose the line-count option while checking whether the last line has a newline. This is a remedy for wc line counting, not the symptom in this cut delimited fields case. Choosing the wrong field or delimiter yields incorrect values.
D:Run `sort` and expect it to select a colon-separated column. This does not remedy the diagnosed cut delimited fields failure; `cut` selects fields based on the delimiter and field number.
Question 767
A lab uses USB media to transport data between Linux hosts. A check then reveals: Writing to the wrong block device can damage another disk's data. Which targeted correction BEST restores the required behavior?
- Check power budget and physical connector compatibility.
- Verify device and mount point names before accessing removable storage.
- Assume every USB stick is always `/dev/sda`.
- Copy files directly into `/proc` as the USB filesystem.
Explanation
Correct Answer
B:Verify device and mount point names before accessing removable storage. This repairs Removable USB block storage and should be checked by seeing that the correct mounted volume contains the expected files.
Incorrect Answers
A:Check power budget and physical connector compatibility. This is a remedy for Power supply for components, not the symptom in this Removable USB block storage case. Writing to the wrong block device can damage another disk's data.
C:Assume every USB stick is always `/dev/sda`. This does not remedy the diagnosed Removable USB block storage failure; removable media may appear as block devices but the mount location is distinct from the device node.
D:Copy files directly into `/proc` as the USB filesystem. This does not remedy the diagnosed Removable USB block storage failure; removable media may appear as block devices but the mount location is distinct from the device node.
Question 768
A script copies a file whose path contains spaces. A check then reveals: An unquoted spaced path is split into separate words and may make the command act on the wrong target. Which targeted correction BEST restores the required behavior?
- Delete the spaces from every file without checking names.
- Place command, option and target in the documented order.
- Run `cd Project Files` and assume it is always one argument.
- Quote or escape pathnames containing whitespace.
Explanation
Correct Answer
D:Quote or escape pathnames containing whitespace. This repairs Escaping spaces in shell paths and should be checked by seeing that the shell treats the spaced name as one pathname instead of multiple words.
Incorrect Answers
A:Delete the spaces from every file without checking names. This does not remedy the diagnosed Escaping spaces in shell paths failure; unquoted whitespace can split one intended argument into several tokens.
B:Place command, option and target in the documented order. This is a remedy for Bash command and argument structure, not the symptom in this Escaping spaces in shell paths case. An unquoted spaced path is split into separate words and may make the command act on the wrong target.
C:Run `cd Project Files` and assume it is always one argument. This does not remedy the diagnosed Escaping spaces in shell paths failure; unquoted whitespace can split one intended argument into several tokens.
Question 769
An operator needs to explain why file deletion depends on the containing directory. A check then reveals: Assuming file write permission is sufficient for deletion leads to mistaken access analysis. Which targeted correction BEST restores the required behavior?
- Rename the filename extension to bypass directory policy.
- Choose and test an appropriate mask for the working context.
- Add only file read permission expecting deletion rights.
- Inspect parent-directory permissions and sticky-bit behavior.
Explanation
Correct Answer
D:Inspect parent-directory permissions and sticky-bit behavior. This repairs Directory write and delete rights and should be checked by seeing that deletion is allowed or denied according to directory-level rights and protection.
Incorrect Answers
A:Rename the filename extension to bypass directory policy. This does not remedy the diagnosed Directory write and delete rights failure; unlinking a file requires permissions on its directory rather than necessarily on the file's own write bit.
B:Choose and test an appropriate mask for the working context. This is a remedy for umask default permission reduction, not the symptom in this Directory write and delete rights case. Assuming file write permission is sufficient for deletion leads to mistaken access analysis.
C:Add only file read permission expecting deletion rights. This does not remedy the diagnosed Directory write and delete rights failure; unlinking a file requires permissions on its directory rather than necessarily on the file's own write bit.
Question 770
A hardware technician maps USB peripherals to the main system board. A check then reveals: Confusing removable peripherals with the motherboard misstates system architecture. Which targeted correction BEST restores the required behavior?
- Classify a USB mouse as the system's RAM.
- Identify the appropriate mainboard connectors and device interfaces.
- Match the storage medium to I/O requirements and budget.
- Call the operating system kernel the motherboard.
Explanation
Correct Answer
B:Identify the appropriate mainboard connectors and device interfaces. This repairs Motherboard and peripherals and should be checked by seeing that component slots and buses connect through the board's interfaces.
Incorrect Answers
A:Classify a USB mouse as the system's RAM. This does not remedy the diagnosed Motherboard and peripherals failure; the motherboard provides electrical and communication pathways between system components.
C:Match the storage medium to I/O requirements and budget. This is a remedy for SSD versus rotational disk, not the symptom in this Motherboard and peripherals case. Confusing removable peripherals with the motherboard misstates system architecture.
D:Call the operating system kernel the motherboard. This does not remedy the diagnosed Motherboard and peripherals failure; the motherboard provides electrical and communication pathways between system components.