101-500 Practice Questions
Prepare for 101-500 with more than an answer.
Unlock the full exam and previous versions
- v1Standard 225 questions Current
- 101-400Legacy LPIC-1 Exam 101 v4.0 169 questions Locked
- Exam fee
- $200 USD
- Level
- Associate
- Valid for
- 5 years
Domains covered on the exam 4
- System Architecture13%
- Linux Installation and Package Management20%
- GNU and Unix Commands42%
- Devices, Linux Filesystems, Filesystem Hierarchy Standard24%
- 1
A Debian package creates several files during its installation.
Which of the following commands searches for packages owning the file /etc/debian_version?
Show answer details
Correct answer: D
The dpkg -S command searches for packages that own the specified file. This is useful for determining which package installed a particular file on the system. The -S option stands for search and will show the package name followed by the file path. The other options are incorrect: -l lists installed packages, -f shows package information, -L lists files owned by a package, and -i installs packages.
- 2
Which of the following commands prints a list of usernames (first column) and their primary group (fourth column) from the /etc/passwd file?
Show answer details
Correct answer: B
The command cut -d : -f 1,4 /etc/passwd extracts the first and fourth fields from the /etc/passwd file using colon as the delimiter. In /etc/passwd, the first field is the username and the fourth field is the primary group ID (GID). The -d option specifies the delimiter, and -f specifies which fields to extract. The other options use incorrect delimiters, field numbers, or awk syntax.
- 3
Which of the following commands generates a list of user names from /etc/passwd along with their login shell?
Show answer details
Correct answer: E
The command cut -d: -f1,7 /etc/passwd extracts the username (field 1) and login shell (field 7) from the /etc/passwd file. The seventh field in /etc/passwd contains the user login shell path. The -d: specifies colon as the field delimiter, and -f1,7 selects the first and seventh fields. The other options use incorrect field numbers that do not correspond to the username and shell fields.
- 4
Which of the following commands list all files and directories within the /tmp/ directory and its subdirectories which are owned by the user root? (Choose two.)
Show answer details
Correct answer: A, D
The command find /tmp -user root -print searches for all files and directories owned by the user root within /tmp and its subdirectories, then prints the results. The -user option specifies the file owner, and -print explicitly displays the matching files. This command recursively searches through all subdirectories. The other options use incorrect syntax or operators that are not valid find command parameters.
The command find /tmp -user root also searches for files owned by root in /tmp and subdirectories. The -print option is implied by default when no other action is specified, so this shorter version produces the same output as the explicit -print version. The find command recursively searches directories unless specifically limited with options like -maxdepth. Both versions correctly identify root-owned files and directories.
- 5
A developer starts a web service from their interactive SSH session using
./webservice &. They observe that when they close their SSH client, the web service process is also terminated. Which command should the developer use to start the service so it continues running after the SSH session is closed and is immune to the hangup signal (SIGHUP)?graph TD subgraph "Interactive Session" A[SSH Daemon] --> B{User Shell} B --> C[./webservice &] end B -- SIGHUP on exit --> CShow answer details
Correct answer: C
The
nohup(no hangup) command is specifically designed for this purpose. It runs a command immune to hangups, with output to a non-tty. When used with&, it runs the command in the background and prevents it from being terminated when the user logs out. Any output is typically redirected tonohup.out. - 6
Which of the following regular expressions represents a single upper-case letter?
Show answer details
Correct answer: B
The character class [A-Z] correctly matches any single uppercase letter from A to Z. Character classes in regular expressions use square brackets to define a range or set of characters. The other options are incorrect: ;UPPER: is not a valid regular expression syntax, !a-z uses shell negation syntax rather than regex, %c is not valid regex syntax, and {AZ} uses curly braces which specify repetition counts, not character classes.
- 7
Running chmod 640 filea.txt as a regular user doesn’t update filea.txt’s permission.
What might be a reason why chmod cannot modify the permissions? (Choose two.)
Show answer details
Correct answer: A, B
A regular user cannot change permissions of files they do not own, which is a fundamental Linux security principle. Additionally, symbolic links have fixed permissions (typically 777) that cannot be changed directly because the chmod command affects the target file, not the link itself. The other options are incorrect: the sticky bit does not prevent regular permission changes by the owner, hard links share permissions with their target (changing one changes all), and SetUID does not restrict chmod operations to root only.
Symbolic links have fixed permissions that cannot be modified directly because chmod operations on a symbolic link actually affect the target file, not the link itself. When combined with ownership restrictions, this explains why chmod might fail. The symbolic link permissions shown by ls -l are always lrwxrwxrwx and are not changeable. The other options are incorrect: the sticky bit, hard link behavior, and SetUID restrictions do not prevent chmod operations in the described scenarios.
- 8
Which of the following sequences in the vi editor saves the opened document and exits the editor? (Choose two.)
Show answer details
Correct answer: D, E
The command sequence Esc :wq saves the file and exits vi by first pressing Escape to enter command mode, then typing :wq which means write (save) and quit. This is the most common and explicit way to save and exit. The other correct answer ZZ also saves and exits, while the incorrect options use invalid key combinations or syntax that do not exist in vi.
The command ZZ in vi saves the current file and exits the editor when pressed after Escape. This is a quick shortcut equivalent to :wq but requires fewer keystrokes. Both ZZ and :wq perform the same function of saving changes and exiting. The other options are incorrect: Ctrl XX is not a vi command, Ctrl :W is invalid syntax, and Esc zz (lowercase) does not save and exit.
- 9
Which command is used to start another command with a given nice level? (Specify ONLY the command without any path or parameters.)
Show answer details
Correct answer: A
The nice command is used to start processes with a modified scheduling priority (nice value). It allows you to run commands with lower or higher priority relative to other processes. The nice value ranges from -20 (highest priority) to 19 (lowest priority), with 0 being the default. Only the command name nice is required as the answer, without path or parameters as specified in the question.
- 10
A yum repository can declare sets of related packages. Which yum command installs all packages belonging to the group admintools?
Show answer details
Correct answer: C
The yum groupinstall command installs all packages that belong to a specific package group. Package groups are predefined collections of related software packages that serve a common purpose. The admintools group would contain various system administration utilities. The other options are incorrect: pkgsel is not a yum subcommand, the /* syntax is not valid for group operations, taskinstall and collection install are not valid yum commands.
