LPI 010-160 Practice Test 13
Question 120
A developer has a shell script readable by its owner but not executable. Which action BEST accomplishes the stated Linux task?
- Run `chmod u+x script.sh` to add execute permission for the owner.
- Run `chmod a+x` and claim only owner rights changed.
- Use `chown` to set an execute bit directly.
- Expect changing a file extension to grant execute access.
Explanation
Correct Answer
A:Run `chmod u+x script.sh` to add execute permission for the owner. Symbolic chmod adds or removes rights for specified classes without necessarily replacing other rights. To confirm completion, the resulting owner permission triplet includes the execute bit.
Incorrect Answers
B:This changes the workflow in the wrong way for chmod symbolic execute flag.
C:Use `chown` to set an execute bit directly. It does not meet the requirement in this case: A developer has a shell script readable by its owner but not executable. Symbolic chmod adds or removes rights for specified classes without necessarily replacing other rights.
D:Expect changing a file extension to grant execute access. It would not produce the expected result: The resulting owner permission triplet includes the execute bit. The named operation concerns chmod symbolic execute flag.
Question 121
A student compares organizations that promote software freedoms and open-source licensing. Which action BEST accomplishes the stated Linux task?
- Distinguish the FSF's free-software advocacy from the OSI's open-source definition and license review.
- Claim the OSI writes the Linux kernel's source code.
- Assert that the FSF is a Linux package manager.
- Assume neither organization concerns software licensing.
Explanation
Correct Answer
A:Distinguish the FSF's free-software advocacy from the OSI's open-source definition and license review. FSF and OSI overlap in many licenses but emphasize different frameworks and programs. To confirm completion, the organizations and their public missions are identified correctly.
Incorrect Answers
B:Claim the OSI writes the Linux kernel's source code. It does not meet the requirement in this case: A student compares organizations that promote software freedoms and open-source licensing. FSF and OSI overlap in many licenses but emphasize different frameworks and programs.
C:This changes the workflow in the wrong way for FSF versus OSI organizations.
D:Assume neither organization concerns software licensing. It would not produce the expected result: The organizations and their public missions are identified correctly. The named operation concerns FSF versus OSI organizations.
Question 122
A small web application needs persistent relational tables and SQL queries. Which action BEST accomplishes the stated Linux task?
- Set a Firefox browser profile as the relational database.
- Install MariaDB or MySQL and create the required schema and user permissions.
- Use only GIMP image layers to store structured application records.
- Use NFS exports instead of SQL tables.
Explanation
Correct Answer
B:Install MariaDB or MySQL and create the required schema and user permissions. MariaDB and MySQL are relational database servers rather than file-sharing daemons. To confirm completion, sQL queries retrieve stored records through the configured database service.
Incorrect Answers
A:Set a Firefox browser profile as the relational database. It does not meet the requirement in this case: A small web application needs persistent relational tables and SQL queries. MariaDB and MySQL are relational database servers rather than file-sharing daemons.
C:Use only GIMP image layers to store structured application records. It would not produce the expected result: SQL queries retrieve stored records through the configured database service. The named operation concerns MariaDB and MySQL data stores.
D:Use NFS exports instead of SQL tables. This changes the workflow in the wrong way for MariaDB and MySQL data stores. Choosing an HTTP server alone does not provide relational tables. For this task the appropriate operation is to install MariaDB or MySQL and create the required schema and user permissions.
Question 123
A user saves `backup.sh` but gets permission denied when invoking `./backup.sh`. Which action BEST accomplishes the stated Linux task?
- Rename the file extension to .exe.
- Use `chmod -x backup.sh` expecting direct execution.
- Mark the script executable with `chmod +x backup.sh` and use `./backup.sh`.
- Assume all newly created text files automatically execute.
Explanation
Correct Answer
C:Mark the script executable with `chmod +x backup.sh` and use `./backup.sh`. Executable permission and interpreter availability are relevant to direct script invocation. To confirm completion, the script runs when invoked directly by a permitted user.
Incorrect Answers
A:Rename the file extension to .exe. It does not meet the requirement in this case: A user saves `backup.sh` but gets permission denied when invoking `./backup.sh`. Executable permission and interpreter availability are relevant to direct script invocation.
B:Use `chmod -x backup.sh` expecting direct execution. This changes the workflow in the wrong way for Script execute permission. A readable but non-executable script may require explicit interpreter invocation. For this task the appropriate operation is to mark the script executable with `chmod +x backup.sh` and use `./backup.sh`.
D:Assume all newly created text files automatically execute. It would not produce the expected result: The script runs when invoked directly by a permitted user. The named operation concerns Script execute permission.
Question 124
A background command is still running and an operator wants its process identifier. Which action BEST accomplishes the stated Linux task?
- Run `ps` with suitable options for the relevant process set.
- Expect `ls -a` to show active process state.
- Use `touch` to obtain the PID list.
- Run `free` to list all process command lines.
Explanation
Correct Answer
A:Run `ps` with suitable options for the relevant process set. `ps` provides a snapshot of processes, not continuously updated interactive monitoring. To confirm completion, the listing includes process IDs and command information.
Incorrect Answers
B:Expect `ls -a` to show active process state. It would not produce the expected result: The listing includes process IDs and command information. The named operation concerns ps process listing.
C:Use `touch` to obtain the PID list. It does not meet the requirement in this case: A background command is still running and an operator wants its process identifier. `ps` provides a snapshot of processes, not continuously updated interactive monitoring.
D:Run `free` to list all process command lines. This changes the workflow in the wrong way for ps process listing. Reading disk capacity cannot identify all running processes. For this task the appropriate operation is to run `ps` with suitable options for the relevant process set.
Question 125
A student wants a new empty `notes.txt` file in an existing writable directory. Which action BEST accomplishes the stated Linux task?
- Expect `cat missing.txt` to create the absent file.
- Use `rm notes.txt` to refresh its timestamp.
- Run `mkdir notes.txt` to create a regular file.
- Run `touch notes.txt` for a missing file or update timestamps on an existing file.
Explanation
Correct Answer
D:Run `touch notes.txt` for a missing file or update timestamps on an existing file. `touch` creates an empty file when missing and normally updates timestamps when present. To confirm completion, the file exists or its timestamp changes without adding text contents.
Incorrect Answers
A:Expect `cat missing.txt` to create the absent file. It would not produce the expected result: The file exists or its timestamp changes without adding text contents. The named operation concerns touch empty files and timestamps.
B:Use `rm notes.txt` to refresh its timestamp. It does not meet the requirement in this case: A student wants a new empty `notes.txt` file in an existing writable directory. `touch` creates an empty file when missing and normally updates timestamps when present.
C:This changes the workflow in the wrong way for touch empty files and timestamps.
Question 126
A team member reuses one simple password across multiple services. Which action BEST accomplishes the stated Linux task?
- Use the same password for every administrator account.
- Use unique strong passwords managed securely and enable multifactor authentication where offered.
- Store all account passwords in a public README.
- Turn off MFA because passwords are hard to remember.
Explanation
Correct Answer
B:Use unique strong passwords managed securely and enable multifactor authentication where offered. Unique secrets reduce credential-reuse exposure; MFA adds an independent verification factor. To confirm completion, different accounts use distinct credentials and supported second factors.
Incorrect Answers
A:Use the same password for every administrator account. It does not meet the requirement in this case: A team member reuses one simple password across multiple services. Unique secrets reduce credential-reuse exposure; MFA adds an independent verification factor.
C:Store all account passwords in a public README. This changes the workflow in the wrong way for Password manager and multifactor authentication. Reusing a breached password can compromise unrelated accounts. For this task the appropriate operation is to use unique strong passwords managed securely and enable multifactor authentication where offered.
D:Turn off MFA because passwords are hard to remember. It would not produce the expected result: Different accounts use distinct credentials and supported second factors. The named operation concerns Password manager and multifactor authentication.
Question 127
A user wants to return to their login home directory from `/tmp`. Which action BEST accomplishes the stated Linux task?
- Treat `~` as the current directory marker.
- Use `cd /` as the user's home directory on every system.
- Use `cd ..` and assume one ascent always reaches home.
- Use `cd ~` or bare `cd` to return to the current user's home.
Explanation
Correct Answer
D:Use `cd ~` or bare `cd` to return to the current user's home. Shell tilde expansion and bare `cd` provide convenient home-directory navigation. To confirm completion, `pwd` shows the current user's configured home directory.
Incorrect Answers
A:Treat `~` as the current directory marker. It does not meet the requirement in this case: A user wants to return to their login home directory from `/tmp`. Shell tilde expansion and bare `cd` provide convenient home-directory navigation.
B:Use `cd /` as the user's home directory on every system. This changes the workflow in the wrong way for Home directory shorthand. Confusing home with `/` changes the destination. For this task the appropriate operation is to use `cd ~` or bare `cd` to return to the current user's home.
C:Use `cd .` and assume one ascent always reaches home. It would not produce the expected result: `pwd` shows the current user's configured home directory. The named operation concerns Home directory shorthand.
Question 128
A student needs a quick filename search for an indexed configuration file. Which action BEST accomplishes the stated Linux task?
- Run `grep filename` without specifying searchable files.
- Use `passwd filename` to update the index.
- Assume locate always searches live disk bytes immediately.
- Use `locate filename` after ensuring its filename index is available and updated.
Explanation
Correct Answer
D:Use `locate filename` after ensuring its filename index is available and updated. `locate` searches a prebuilt file-name index rather than necessarily scanning the live filesystem. To confirm completion, the command returns matching paths from its filename database.
Incorrect Answers
A:Run `grep filename` without specifying searchable files. It does not meet the requirement in this case: A student needs a quick filename search for an indexed configuration file. `locate` searches a prebuilt file-name index rather than necessarily scanning the live filesystem.
B:Use `passwd filename` to update the index. It would not produce the expected result: The command returns matching paths from its filename database. The named operation concerns locate database lookup.
C:Assume locate always searches live disk bytes immediately. This changes the workflow in the wrong way for locate database lookup. Recently created files may be missing until the index is refreshed. For this task the appropriate operation is to use `locate filename` after ensuring its filename index is available and updated.
Question 129
A student sets `course=linux` in Bash and wants to print its value. Which action BEST accomplishes the stated Linux task?
- Use `echo %course%` as Bash parameter expansion.
- Write `course = linux` as a valid Bash scalar assignment.
- Type `echo course` and expect it to expand the variable.
- Expand the variable with `$` such as `echo "$course"`.
Explanation
Correct Answer
D:Expand the variable with `$` such as `echo "$course"`. Unquoted variable names in an echo command are literal text, while `$name` expands a shell parameter. To confirm completion, the printed output reflects the variable's stored value.
Incorrect Answers
A:Use `echo %course%` as Bash parameter expansion. It does not meet the requirement in this case: A student sets `course=linux` in Bash and wants to print its value. Unquoted variable names in an echo command are literal text, while `$name` expands a shell parameter.
B:Write `course = linux` as a valid Bash scalar assignment. It would not produce the expected result: The printed output reflects the variable's stored value. The named operation concerns echo and shell variables.
C:Type `echo course` and expect it to expand the variable. This changes the workflow in the wrong way for echo and shell variables. Printing the unexpanded identifier does not display its value. For this task the appropriate operation is to expand the variable with `$` such as `echo "$course"`.
Question 130
A security auditor must explain why ordinary users cannot view stored password hashes. Which action BEST accomplishes the stated Linux task?
- Recognize `/etc/shadow` as a protected repository for password hashes and password-aging data.
- Remove shadow protections to allow everyone to inspect hashes.
- Assume `/etc/shadow` is the DNS resolver list.
- Put all password hashes into a public web directory.
Explanation
Correct Answer
A:Recognize `/etc/shadow` as a protected repository for password hashes and password-aging data. Shadow password storage separates sensitive credential information from generally readable account metadata. To confirm completion, file access restrictions keep sensitive authentication fields from ordinary readers.
Incorrect Answers
B:Remove shadow protections to allow everyone to inspect hashes. It would not produce the expected result: File access restrictions keep sensitive authentication fields from ordinary readers. The named operation concerns /etc/shadow protected credentials.
C:Assume `/etc/shadow` is the DNS resolver list. It does not meet the requirement in this case: A security auditor must explain why ordinary users cannot view stored password hashes. Shadow password storage separates sensitive credential information from generally readable account metadata.
D:Put all password hashes into a public web directory. This changes the workflow in the wrong way for /etc/shadow protected credentials. Making shadow data world-readable exposes password hashes for offline attack. For this task the appropriate operation is to recognize `/etc/shadow` as a protected repository for password hashes and password-aging data.