Courseiva

LPI Linux Essentials (010-160, v1.6) (010-160) (010-160) — Questions 151–225

323 questions total · 5 pages · All types, answers revealed

Page 2

Page 3 of 5

Page 4
151
MCQhard

An operator is at a prompt and types cd - after having earlier changed from /etc/nginx to /var/www/html. What is the effect of that command?

A.It changes to the root directory because a lone dash is interpreted as the filesystem root.
B.It fails with an error because cd requires a valid directory path and a dash is not a path.
C.It moves up one level to the parent of the current directory, /var/www.
D.It returns the shell to /etc/nginx, the previous working directory, and prints that path.
AnswerD

The dash is a special operand that the cd builtin maps to the OLDPWD variable, which the shell updates on each successful directory change. Since the operator moved from /etc/nginx to /var/www/html, OLDPWD holds /etc/nginx, so the command switches back there and echoes the new directory.

Why this answer

The shell maintains the OLDPWD variable and updates it after every successful directory change. The cd builtin treats a bare dash as a request to switch to that stored path and then prints it, giving a quick toggle between two working directories without retyping long paths.

Exam trap

The trap here is confusing the dash with the two-dot parent reference or with the root slash, when the dash actually means the previous directory.

152
MCQmedium

A user reports that a script at /usr/local/bin/backup.sh runs with the permissions of the file's owner rather than the user who invoked it, and that this behaviour is intentional for a scheduled task. Which permission bit is responsible for this behaviour?

A.The setgid bit on the script, shown as an s in the group execute position.
B.The setuid bit on the script, shown as an s in the owner execute position.
C.The sticky bit on the script, shown as a t in the others execute position.
D.The execute bit for others combined with a umask of 022.
AnswerB

When setuid is set on an executable, the process runs with the effective UID of the file's owner rather than the invoking user. This is the classic mechanism that lets a program act with elevated privilege for a specific task. The scenario describes exactly that elevation, and the bit is displayed as an s where the owner's execute permission normally appears.

Why this answer

The setuid bit, set on an executable, makes the kernel run the resulting process with the effective UID of the file's owner. That is the only permission bit among the choices that changes the user identity of a running program. It is displayed as an s in the owner execute position of ls output.

Exam trap

The trap here is treating setgid and setuid as interchangeable, when only setuid changes the effective user identity of the process.

153
MCQhard

You want to create a symbolic link named 'link_to_file' that points to 'original_file'. Which command is correct?

A.link original_file link_to_file
B.ln -h original_file link_to_file
C.ln original_file link_to_file
D.ln -s original_file link_to_file
AnswerD

The -s flag instructs ln to create a symbolic link rather than a hard link, and the syntax places the existing target first, followed by the new link name. This produces 'link_to_file' pointing to 'original_file' as required.

Why this answer

The `ln -s` command creates a symbolic link, which is a special file that points to another file by name. The syntax is `ln -s <target> <link_name>`, so `ln -s original_file link_to_file` correctly creates a symlink named `link_to_file` that references `original_file`. Without `-s`, `ln` creates a hard link, which is a different mechanism entirely.

Exam trap

The trap here is confusing hard links with symbolic links: candidates may think `ln` alone creates a symbolic link, but it actually creates a hard link; the `-s` flag is mandatory for symbolic links.

How to eliminate wrong answers

Option A is wrong because `link` is a low-level utility that creates hard links only and does not support symbolic links; it also takes arguments in the order `link <target> <link_name>`, but even with correct order it cannot create a symlink. Option B is wrong because `ln -h` is not a valid option for creating symbolic links; `-h` is sometimes used with other commands to affect how symlinks are followed, but for `ln` it is not the flag for symlink creation. Option C is wrong because `ln original_file link_to_file` creates a hard link, not a symbolic link; hard links share the same inode and cannot cross filesystems or link to directories.

154
Multi-Selecthard

A Linux administrator is reviewing how environment variables affect command execution. Which TWO of the following statements about environment variables are correct? (Choose two.)

Select 2 answers
A.Environment variables are always inherited by child processes unless explicitly unset.
B.Environment variables can only be set by the root user.
C.The PATH variable defines the directories searched for executable commands.
D.The PS1 variable controls the system's primary network interface.
E.The HOME variable stores the system's hostname.
AnswersA, C

When a process creates a child process, the child inherits a copy of the parent's environment by default. This inheritance allows settings like PATH and HOME to propagate. Variables can be removed with unset or not exported, but the default behavior is inheritance, making this statement correct.

Why this answer

PATH determines where the shell looks for executables, and environment variables are inherited by child processes by default. These two properties are central to how commands are located and how settings propagate in a Linux session. The other statements misidentify HOME and PS1 and incorrectly restrict variable setting to root, so they are not correct.

Exam trap

The trap here is assuming environment variables are only for root or that HOME holds the hostname, when HOME is the user's home directory.

155
Multi-Selecthard

Which TWO of the following signals can be used to interact with processes?

Select 2 answers
A.SIGTERM
B.SIGKILL
C.SIGSTOPPED
D.SIGEXIT
E.SIGRUN
AnswersA, B

SIGTERM requests graceful process termination, allowing the program to save state and release resources before exiting. It satisfies the stem's requirement for a signal used to interact with running processes, since the kernel delivers it to a target process, which may catch, ignore, or handle it rather than being forcibly killed.

Why this answer

SIGTERM (A) is a standard, catchable termination signal (signal number 15) that can be sent to a process with the kill command to request it to shut down gracefully, allowing it to run cleanup handlers before exiting. SIGKILL (B) is signal number 9, an uncatchable and unblockable signal that forcibly terminates a process immediately, making it the other valid way to interact with and control a running process. The remaining options are not real signals: SIGSTOPPED (C) is not a defined signal (the actual stop signal is SIGSTOP, number 19), SIGEXIT (D) does not exist in the standard signal set, and SIGRUN (E) is likewise not a valid signal name.

Exam trap

The trap is that the wrong options look like plausible signal names (SIGSTOPPED, SIGEXIT, SIGRUN) — candidates must recall the actual signal set and recognise that SIGSTOPPED is a state, not a signal.

156
MCQmedium

A junior administrator is told that a popular server distribution is 'based on Debian.' She wants to verify this claim on a running system by inspecting files that identify the distribution and its upstream lineage, without installing any extra tools. Which file should she examine to see the distribution ID and the ID of the upstream distribution it derives from?

A./etc/motd
B./etc/os-release
C./etc/issue
D./etc/hostname
AnswerB

This file is the standard, machine-readable identity file defined by the freedesktop.org specification and present on essentially all modern distributions. It contains keys such as ID, NAME and, importantly for derived distributions, ID_LIKE, which names the upstream family. On a Debian derivative, ID_LIKE=debian confirms the lineage, so inspecting it answers the question directly without installing additional packages.

Why this answer

The identity file in /etc that follows a defined key=value format is the correct place to look, because it exposes both the distribution's own identifier and, through the ID_LIKE field, the upstream family it derives from. Console banners, login messages and the hostname file contain arbitrary or unrelated text and cannot establish distribution lineage.

Exam trap

The trap here is assuming that any file under /etc that mentions a distribution name is authoritative, when in fact only the structured identity file defines lineage through a dedicated upstream field.

157
Multi-Selectmedium

Which THREE of the following are common activities for a Linux system administrator?

Select 3 answers
A.Managing user accounts and permissions
B.Creating commercial advertisements for Linux
C.Applying security patches and updates
D.Monitoring system logs and performance
E.Developing proprietary hardware drivers
AnswersA, C, D

Creating, modifying and deleting user accounts, plus setting file ownership and permission bits, is core day-to-day administration. It satisfies the stem's request for common system administrator activities, since access control on a multi-user Linux host depends on these tasks.

Why this answer

Option A (Managing user accounts and permissions) is correct because a core Linux sysadmin duty is creating, modifying, and deleting users and groups with commands like useradd, usermod, and passwd, and controlling access via file ownership (chown/chgrp) and permission bits or ACLs. Option C (Applying security patches and updates) is correct because administrators must keep systems hardened and current by applying kernel and package updates through package managers such as apt, dnf/yum, or zypper, and by tracking security advisories (e.g., CVEs). Option D (Monitoring system logs and performance) is correct because admins routinely inspect logs in /var/log and via journalctl, and track CPU, memory, disk, and network metrics using tools like top, vmstat, iostat, sar, and monitoring platforms to detect and resolve issues.

Option B (Creating commercial advertisements for Linux) is not a technical system administration task but a marketing function, and Option E (Developing proprietary hardware drivers) is kernel/driver development work typically performed by developers or vendors, not a routine sysadmin activity.

Exam trap

The trap is including plausible-sounding but non-administrative tasks like driver development or marketing, which are outside the scope of a sysadmin's typical responsibilities.

158
Multi-Selecthard

Which THREE of the following are valid ways to run commands sequentially?

Select 3 answers
A.;
B.|
C.>
D.&&
E.||
AnswersA, D, E

The semicolon operator runs commands sequentially regardless of whether earlier commands succeed, satisfying the requirement for unconditional sequential execution. Unlike `&&`, which halts on failure, or `||`, which runs only after failure, `;` simply separates and orders commands, making it a valid mechanism for running them one after another.

Why this answer

Option A (;) is correct because the semicolon is the shell's unconditional command separator, so `cmd1 ; cmd2` runs cmd2 after cmd1 finishes regardless of cmd1's exit status. Option D (&&) is correct because the logical AND operator runs the second command only if the first command exits successfully (exit status 0), which is a standard way to chain commands sequentially with dependency. Option E (||) is correct because the logical OR operator runs the second command only if the first command fails (non-zero exit status), also executing commands one after another in sequence.

Option B (|) is not a sequential runner but a pipe that connects the standard output of one command to the standard input of another, and both processes typically run concurrently. Option C (>) is a redirection operator that sends standard output to a file, not a command-sequencing construct.

Exam trap

The trap here is confusing the pipe (|), which chains commands as a data pipeline, with the sequential control operators (;, &&, ||), causing candidates to select | as a way to run commands one after another.

159
MCQhard

A Linux administrator is troubleshooting a server that fails to boot completely. The system starts but drops into an emergency shell. Which command should the administrator use to view the most recent kernel messages that might indicate the cause?

A.journalctl -b -p err
B.dmesg | tail -50
C.cat /var/log/syslog
D.last -x
AnswerB

The dmesg command displays the kernel ring buffer, which contains messages from the kernel, including hardware detection, driver initialization, and errors during boot. Piping to tail -50 shows the most recent 50 lines, which are likely to include the last messages before the failure. This is the most direct way to view recent kernel messages and diagnose boot issues.

Why this answer

The kernel ring buffer, accessed via dmesg, holds the most recent kernel messages, including those generated during boot. When a system drops to an emergency shell, dmesg is often still available and can reveal hardware or driver errors. Other logs may be incomplete or unavailable in that state, making dmesg the most direct tool.

Exam trap

The trap here is assuming that any system log will contain the needed kernel messages, when early boot issues may only be visible in the kernel ring buffer.

160
Multi-Selectmedium

Which TWO of these tools can modify file ownership or permissions?

Select 2 answers
A.groupdel
B.useradd
C.chown
D.usermod
E.chmod
AnswersC, E

chown changes a file's owning user and/or group, directly satisfying the stem's requirement to modify ownership. It cannot alter permission bits, so it complements chmod rather than replacing it. Together they cover the two distinct metadata axes the question asks about.

Why this answer

chown (C) is correct because it directly changes the owner and/or group of files and directories, e.g. chown user:group file. chmod (E) is correct because it modifies file permission bits (read/write/execute for user, group, and others) using symbolic or octal modes. groupdel (A) only removes a group from the system and does not alter file ownership or permissions. useradd (B) creates new user accounts and does not touch existing files' ownership or permissions. usermod (D) modifies user account attributes such as group membership or shell, but it does not change file ownership or permissions.

Exam trap

The trap here is confusing user account management commands (useradd, usermod, groupdel) with file attribute modification commands (chown, chmod). Candidates might think that usermod can change file ownership because it modifies user properties, but it does not.

161
MCQhard

You need to find files modified within the last 7 days. Which find flag is correct?

A.find . -ctime 7
B.find . -mtime -7
C.find . -mtime +7
D.find . -atime 7
AnswerB

The -mtime -7 predicate matches files whose data was modified less than seven days ago, satisfying the requirement to find recently modified files. The minus sign means "less than", whereas +7 would match files older than seven days.

Why this answer

The `-mtime -7` predicate matches files whose modification time is less than 7 days ago (i.e., within the last 7 days). The minus sign means 'less than N', so `-mtime -7` correctly captures recently modified files. This is the standard find syntax for time-based filtering and directly answers the requirement.

Exam trap

The trap is the sign convention — candidates often assume `-mtime 7` means 'within 7 days', but the bare number means exactly 7 days, the minus means less than, and the plus means more than, so only `-mtime -7` fits 'within the last 7 days'.

How to eliminate wrong answers

Option A is wrong because `-ctime 7` matches files whose inode change time is exactly 7 days old (24-hour periods), not files modified within the last 7 days — and ctime tracks metadata changes, not content modification. Option C is wrong because `-mtime +7` matches files modified *more* than 7 days ago, the opposite of what is needed. Option D is wrong because `-atime 7` matches files accessed exactly 7 days ago (access time), not modified within the last 7 days, and atime is often disabled via noatime mounts.

162
MCQhard

A software engineer at a medical device company wants to use an open source library licensed under the GNU GPLv3 in a product that will be shipped as a closed-source firmware binary. The company's legal team is concerned about compliance. What is the primary obligation the company must meet under the GPLv3?

A.The company must remove all GPLv3 code from the firmware and replace it with a permissively licensed alternative to avoid disclosure.
B.The company must publish the complete source code of its proprietary firmware under the GPLv3.
C.The company must pay a royalty to the Free Software Foundation for each device sold that includes the GPLv3 library.
D.The company must provide the source code of the GPLv3 library and any modifications it makes to that library, along with the license text, to recipients of the firmware.
AnswerD

Under the GPLv3, if the company distributes the library as part of the firmware, it must convey the corresponding source code of the library and any modifications, and include the license text. This ensures recipients can exercise their freedoms. The proprietary firmware components that are separate works can remain closed.

Why this answer

The GPLv3 requires that when a covered library is distributed as part of a product, recipients receive the library's source code, any modifications, and the license text. The company's own proprietary firmware can remain closed if it is not a derivative work of the library. Compliance focuses on conveying source and license, not on relicensing the entire product or paying fees.

Exam trap

The trap here is assuming the GPLv3 forces all linked proprietary code to become open source, when the obligation is limited to the covered work and its derivatives.

163
MCQhard

A junior administrator runs `grep -r "timeout" /etc` inside a Bash login shell. The output scrolls past the terminal window, so the administrator wants to view the complete results one screen at a time while also being able to scroll back through the earlier lines. Which command should the administrator have used instead?

A.grep -r "timeout" /etc &
B.grep -r "timeout" /etc | less
C.grep -r "timeout" /etc | tee
D.grep -r "timeout" /etc > /dev/null
AnswerB

Piping the recursive grep output into less launches a pager that displays one screenful at a time and lets the administrator scroll forward and backward through the entire result set. This directly satisfies both requirements: viewing the complete output screen by screen and being able to revisit earlier lines without rerunning the search.

Why this answer

Sending the recursive grep results through a pager is the standard way to review long output interactively. The less pager presents one screenful at a time and supports scrolling backward and forward, so the administrator can read every matched line and revisit earlier ones. The other choices either discard the output, duplicate the original scrolling behaviour, or detach the job without improving readability.

Exam trap

The trap here is assuming that any pipe changes how output is presented, when only a pager such as less actually buffers the results for interactive screen-by-screen viewing.

164
MCQhard

You want to change the owner of 'data.txt' from 'user1' to 'user2' AND the group from 'group1' to 'group2' in one command. Which is correct?

A.chown user2 -g group2 data.txt
B.chown user2 group2 data.txt
C.chown user2:group2 data.txt
D.chown user2 data.txt && chgrp group2 data.txt
AnswerC

`chown` accepts a combined owner and group specification separated by a colon, so `user2:group2` changes both attributes in a single invocation. This satisfies the stem's requirement to alter owner and group simultaneously, unlike `chgrp`, which only reassigns group ownership and cannot modify the file's owner.

Why this answer

The chown command accepts the syntax 'chown user:group file' to change both owner and group in a single invocation. Using the colon as a separator between user and group is the canonical POSIX form, and chown also accepts a dot (chown user.group file) on most Linux systems. Option C is the only choice that correctly combines both changes into one valid command.

Exam trap

The trap here is confusing chown's syntax with chgrp's -g flag or assuming chown takes two positional arguments like 'chown user group file' — the exam tests whether you know the colon/dot delimiter is mandatory.

How to eliminate wrong answers

Option A is wrong because chown does not support a '-g' flag; that flag belongs to chgrp, not chown, so the command would fail with an invalid option error. Option B is wrong because passing two bare arguments to chown is interpreted as 'chown user file' with 'group2' treated as a second filename, not as a group — chown requires a colon or dot to delimit the group. Option D is wrong because it uses two separate commands joined by &&, which changes ownership and group sequentially rather than in one command as the question requires, and it is less efficient than the single chown invocation.

165
MCQmedium

A junior administrator is asked to determine which shell will be launched for a user named 'alex' upon login. The administrator inspects the /etc/passwd file and sees the following line: alex:x:1001:1001:Alex Smith:/home/alex:/bin/bash. Which field in this line specifies the login shell?

A.The third field, 1001
B.The fifth field, Alex Smith
C.The seventh field, /bin/bash
D.The sixth field, /home/alex
AnswerC

In /etc/passwd, fields are colon-separated: username, password placeholder, UID, GID, GECOS, home directory, and login shell. The seventh field, /bin/bash, is the login shell that runs when alex logs in. This is the correct identification for this scenario.

Why this answer

The /etc/passwd file stores user account information in seven colon-separated fields. The login shell is the last field, here /bin/bash, which is executed when the user logs in interactively. Correctly reading this field helps administrators verify or change a user's default shell, which is essential for troubleshooting login environments and scripting behavior.

Exam trap

The trap here is assuming the home directory field determines the shell, but the home directory only sets the initial working directory.

166
MCQmedium

A nonprofit organization wants to deploy a Linux distribution whose development is guided by a foundation with transparent governance and community-elected leadership, rather than a single commercial vendor. Which distribution characteristic is most relevant to this decision?

A.Whether the distribution uses a rolling or fixed release model
B.Community governance with published decision-making processes
C.The size of the distribution's package repository
D.The frequency of security patch releases
AnswerB

When an organization prioritizes transparent governance and elected leadership, the deciding factor is how the distribution is governed. Community-governed projects publish their charters, election procedures, and technical decision processes, so the nonprofit can verify that no single vendor controls the roadmap. This directly addresses the requirement for foundation-led, community-driven development rather than vendor control.

Why this answer

The organization's requirement is about who governs the distribution and how decisions are made, not about technical update mechanics. Community governance with published, transparent processes and elected leadership is the characteristic that demonstrates the project is not steered by a single commercial vendor. Patch frequency, repository size, and release model all describe operations rather than governance.

Exam trap

The trap here is focusing on technical or operational features such as update frequency when the scenario is really asking about project governance and control.

167
MCQhard

You want to execute two commands sequentially, but only if the first command succeeds. Which operator is used?

A.;
B.||
C.&&
D.|
AnswerC

The && operator runs the second command only when the first exits with status zero, giving conditional sequential execution. The semicolon runs commands regardless of outcome, while || executes the second only on failure, so && matches the success-dependent requirement.

Why this answer

The && operator is the logical AND control operator in Bash and other POSIX shells. It executes the command on the right only if the command on the left exits with a status of 0 (success). This is the standard way to chain commands with a success dependency, such as 'make && make install'.

Exam trap

The trap is confusing && with || or ; — candidates often remember '&& means and' but forget that it specifically gates execution on the success (exit code 0) of the preceding command.

How to eliminate wrong answers

Option A is wrong because the semicolon (;) executes commands sequentially regardless of whether the first command succeeds or fails — it is an unconditional separator. Option B is wrong because the || operator is logical OR and executes the right-hand command only if the left-hand command fails (non-zero exit status), which is the opposite of the requirement. Option D is wrong because the pipe (|) connects the standard output of the left command to the standard input of the right command, running them concurrently as a pipeline, not sequentially with a success condition.

168
MCQmedium

What is the purpose of the '..' notation in a file path?

A.Parent directory
B.Current directory
C.Root directory
D.Home directory
AnswerA

The '..' entry is a hard link present in every directory, pointing to its parent. It lets paths traverse upward, so /home/user/.. resolves to /home. This is distinct from '.' which refers to the current directory itself.

Why this answer

In filesystem path notation, a single dot (.) refers to the current directory, while two dots (..) refer to the parent directory — the directory one level above the current working directory. This is a POSIX convention used across Linux, macOS, and other Unix-like systems.

Exam trap

The trap here is confusing the single dot (current directory) with the double dot (parent directory), or assuming .. always means root — candidates who mix up these symbols pick the wrong option.

How to eliminate wrong answers

Option B is wrong because the current directory is represented by a single dot (.), not two dots. Option C is wrong because the root directory is represented by a leading forward slash (/), not by .. — .. only reaches root if you traverse up enough levels. Option D is wrong because the home directory is referenced by the tilde (~) or the $HOME environment variable, not by ...

169
Multi-Selecthard

Which THREE commands can be used to display information about system memory?

Select 3 answers
A.ifconfig
B.vmstat
C.top
D.lsblk
E.free
AnswersB, C, E

The vmstat command reports virtual memory statistics, including free and used memory, swap activity, and paging. It satisfies the requirement to display system memory information by sampling kernel counters over an interval. Unlike disk-focused tools, vmstat directly exposes memory pressure and swap behaviour, making it a valid choice alongside free and top.

Why this answer

Option B (vmstat) is correct because it reports virtual memory statistics, including swap usage, free and buffered memory, and paging activity. Option C (top) is correct because it displays a live, continuously updated view of memory usage (total, free, used, and buffers/cache) alongside process information. Option E (free) is correct because it directly shows total, used, free, shared, buffered/cached, and available physical and swap memory.

Option A (ifconfig) is incorrect because it configures and displays network interface parameters, not memory. Option D (lsblk) is incorrect because it lists block devices and their mountpoints, which is storage rather than memory information.

Exam trap

The trap is confusing storage-related tools (lsblk) and network tools (ifconfig) with memory tools, since all report 'system information' but only vmstat, top, and free cover RAM.

170
MCQmedium

A junior administrator is troubleshooting a payroll application and runs 'ls -l /srv/payroll/run.sh'. The output shows '-rwxr-x--- 1 root finance 2048 Apr 10 09:14 /srv/payroll/run.sh'. A member of the 'marketing' group complains the script fails with 'Permission denied'. What is the most likely reason?

A.The script lacks the setuid bit, so it cannot run with root privileges and the kernel refuses execution for non-owners.
B.The marketing user is not the file owner and is not a member of the finance group, so the 'others' permission set applies and grants no access.
C.The 'others' class has write permission removed, and Linux requires write access on a file before it can be executed by a non-owner.
D.The execute bit is missing from the group class, so even finance members cannot run the script and the shell falls back to the others class.
AnswerB

The permission string ends in '---', which is the others class. Since the marketing user is neither root nor in the finance group, Linux evaluates the others class, which has no read, write, or execute bits set. Any attempt to run the script is denied before the kernel even parses the interpreter, so the observed error is expected behavior for this ownership and mode combination.

Why this answer

Linux evaluates exactly one permission class per access: owner if the caller's UID matches, otherwise group if any of the caller's groups matches the file's group, otherwise others. A marketing user matches neither owner nor group, so only the trailing '---' applies, producing the denial. Understanding this single-class evaluation is essential when diagnosing access complaints.

Exam trap

The trap here is assuming Linux combines owner, group, and others permissions, when in reality only the single class matching the caller is ever consulted.

171
MCQeasy

A community college instructor is preparing course materials for an introductory Linux class and wants students to understand how the GNU General Public License (GPL) differs from permissive licenses such as the MIT License. Which statement accurately describes a key difference between these two license types?

A.The MIT License requires that all modifications be published back to the original project, while the GPL only requires attribution in documentation.
B.The GPL applies only to the Linux kernel, whereas the MIT License applies to all other open source software.
C.The GPL requires that derivative works distributed to others be licensed under the GPL, while the MIT License permits derivative works to be relicensed under proprietary terms.
D.The GPL forbids any commercial use of the software, while the MIT License allows companies to sell products built on the code.
AnswerC

The GPL is a copyleft license: any distributed derivative work must carry the same license and make source code available. The MIT License is permissive, allowing modified code to be closed and redistributed under proprietary terms as long as the original copyright notice is retained. This distinction is central to understanding license compatibility and commercial reuse.

Why this answer

The key difference is copyleft versus permissive licensing. The GPL ensures that distributed derivative works remain under the GPL with source available, protecting user freedoms downstream. The MIT License instead allows reuse in proprietary products with minimal conditions, typically just attribution and license inclusion.

Understanding this distinction helps students evaluate how projects can be combined and redistributed.

Exam trap

The trap here is assuming the GPL bans commercial activity, when it actually permits selling software and support while imposing copyleft obligations on distributed derivatives.

172
Multi-Selectmedium

A technician is examining files in /var/tmp and needs to identify which entries are directories rather than regular files. Which two commands can provide this information? (Choose two.)

Select 2 answers
A.wc -c /var/tmp
B.ls -l /var/tmp
C.cat /var/tmp/*
D.file /var/tmp/*
E.du -sh /var/tmp
AnswersB, D

The long listing format shows a file type character as the first column of each entry; a leading d indicates a directory, while a leading hyphen indicates a regular file. Running ls -l /var/tmp therefore lets the technician distinguish directories from regular files at a glance, along with permissions, owner, size, and timestamp.

Why this answer

Both ls -l and file reveal the nature of each entry: the long listing encodes the type in its first character, and the file utility prints a descriptive type for every argument. The remaining commands either print raw contents, summarize total disk usage, or count bytes, none of which separates directories from regular files in /var/tmp.

Exam trap

The trap here is assuming that any command which accepts a path can classify it, when cat, du, and wc only measure or dump data rather than report file type.

173
MCQmedium

A server is running out of disk space. Which command allows you to view the space usage of directories in a human-readable format?

A.ls -s
B.fdisk
C.du -sh
D.df -h
AnswerC

`du -sh` reports each directory's total disk consumption, with `-s` collapsing subdirectory detail into one summary figure per argument and `-h` scaling values into human-readable units such as megabytes or gigabytes. This directly satisfies the stem's requirement to inspect directory space usage readably while the server runs low on disk.

Why this answer

The `du` (disk usage) command reports the space consumed by files and directories. The `-s` flag produces a summary total for each argument rather than listing every file, and `-h` renders sizes in human-readable units (K, M, G). Combining them as `du -sh` gives a concise, readable total for a directory, which is exactly what's needed to find what's eating disk space.

Exam trap

The trap here is confusing `du` (disk usage per file/directory) with `df` (disk free per filesystem) — both start with 'd' and both report space, so candidates who only skim pick `df -h`.

How to eliminate wrong answers

Option A is wrong because `ls -s` only prints the allocated block count for each entry in a single directory listing and does not recurse into subdirectories or total their usage. Option B is wrong because `fdisk` is a partition table editor for block devices, not a filesystem usage reporter. Option D is wrong because `df -h` shows free/used space per mounted filesystem, not the space consumed by individual directories.

174
MCQeasy

A developer wants a shell script named `deploy.sh` located in the current directory to be runnable by typing `./deploy.sh`, but currently the command returns 'Permission denied' even though the file contains valid commands. Which command resolves the problem?

A.sudo ./deploy.sh
B.chown root deploy.sh
C.chmod 644 deploy.sh
D.chmod u+x deploy.sh
AnswerD

The execute bit is what allows the kernel to run a file as a program. Granting the owner execute permission with chmod u+x makes ./deploy.sh runnable for the account that owns it, which matches the developer's situation. Read and write bits alone do not permit execution, so adding the execute bit is precisely the missing step.

Why this answer

Executing a file with ./ requires that the file carry execute permission for the invoking user, and chmod u+x grants exactly that to the owner. The other choices either set a mode without any execute bit, change ownership without adding execute, or attempt to elevate privileges around the missing bit. Only adding execute permission addresses the reported error directly.

Exam trap

The trap here is reaching for sudo to work around 'Permission denied' when the real cause is simply a missing execute bit on the file.

175
MCQmedium

What is the purpose of the 'tee' command?

A.To join files
B.To split output to file and screen
C.To format output
D.To filter output
AnswerB

The tee command reads standard input and writes it simultaneously to standard output and to one or more named files, so a pipeline's data appears on screen while also being saved. This satisfies the stem's requirement of splitting output between file and screen.

Why this answer

The 'tee' command reads from standard input and writes to both standard output (the screen) and one or more files simultaneously. It is named after a T-splitter in plumbing, reflecting how it splits the data stream. This is useful for capturing output while still viewing it in real time, such as logging a command's output without losing visibility.

Exam trap

The trap here is confusing 'tee' with commands that combine or filter data, such as 'cat' or 'grep', because all involve input/output manipulation. Candidates might overlook that 'tee' specifically duplicates rather than transforms.

How to eliminate wrong answers

Option A is wrong because joining files is typically done with 'cat' or 'paste', not 'tee'. Option C is wrong because formatting output is handled by tools like 'printf', 'awk', or 'sed', not 'tee'. Option D is wrong because filtering output is the purpose of commands like 'grep', 'sed', or 'awk', whereas 'tee' does not filter; it duplicates.

176
MCQeasy

A new intern is asked to identify which of the following is a Linux distribution rather than a desktop environment or a package manager. Which item should the intern select?

A.Ubuntu
B.systemd
C.APT
D.GNOME
AnswerA

Ubuntu is a complete Linux distribution: it combines the Linux kernel, GNU utilities, a package manager, an installer, and a curated set of applications. That full assembly of components is what distinguishes a distribution from individual pieces like a desktop environment or an init system.

Why this answer

A Linux distribution is a complete operating system assembled from the Linux kernel, GNU tools, a package manager, and applications. Ubuntu fits that definition. GNOME is a desktop environment, systemd is an init system, and APT is a package manager, so none of them is a distribution on its own.

Exam trap

The trap here is treating any well-known Linux component, such as a desktop environment or package manager, as if it were a full distribution.

177
MCQmedium

You want to change the primary group of an existing user named 'bob' to 'staff'. Which command should you use?

A.groupmod -n staff bob
B.chgrp staff bob
C.usermod -g staff bob
D.usermod -G staff bob
AnswerC

`usermod -g staff bob` sets bob's primary group, satisfying the requirement to change an existing user's primary group. The lowercase `-g` flag specifically assigns the primary group, whereas uppercase `-G` would only add supplementary groups, leaving the primary group unchanged.

Why this answer

The usermod command modifies existing user account attributes, and the -g flag specifically sets the user's primary group (the GID stored in /etc/passwd). Running 'usermod -g staff bob' changes bob's primary group to staff while leaving his supplementary group memberships intact. This is the standard, correct way to reassign a primary group on a Linux system.

Exam trap

The trap here is confusing usermod's -g (primary group) with -G (supplementary groups), and confusing usermod with groupmod or chgrp — candidates often pick -G thinking it 'adds' the group when it actually replaces the supplementary list.

How to eliminate wrong answers

Option A is wrong because 'groupmod -n staff bob' renames a group (the -n flag changes the group name), not a user's primary group, and would attempt to rename group 'bob' to 'staff'. Option B is wrong because chgrp changes the group ownership of a file or directory, not a user's primary group membership. Option D is wrong because 'usermod -G staff bob' sets the supplementary (secondary) group list, not the primary group, and would actually replace bob's existing supplementary groups with just 'staff'.

178
MCQhard

A user runs `pwd` and sees `/home/alex/projects`. They then run `cd ../reports` and `pwd` again. What is the second `pwd` output?

A./home/alex/projects/../reports
B./home/reports
C./home/alex/projects/reports
D./home/alex/reports
AnswerD

Starting from `/home/alex/projects`, the `..` component resolves to `/home/alex`. The subsequent `reports` component then descends into the reports directory located there. The final working directory is therefore `/home/alex/reports`. This is a standard relative navigation pattern that combines a parent traversal with a descent into a sibling directory.

Why this answer

The relative path `../reports` first ascends one level from `/home/alex/projects` to `/home/alex`, then descends into the `reports` child there. Since each component is resolved in sequence against the evolving location, the final directory is `/home/alex/reports`, which is what the second `pwd` reports.

Exam trap

The trap here is forgetting that `..` is processed before the following component, so the descent happens in the parent rather than the original directory.

179
MCQeasy

Which command removes a directory and all its contents recursively?

A.rm -rf dir
B.rm -d dir
C.del -r dir
D.rmdir dir
AnswerA

rm -rf combines recursive (-r) traversal of the directory tree with force (-f) suppression of prompts, deleting the directory and all contents. The -r flag satisfies the stem's recursive requirement, while -f avoids interactive confirmation for each entry.

Why this answer

rm -rf dir removes the directory and everything inside it recursively (-r) and forcibly (-f), without prompting. This is the standard command to delete a directory tree. The other options either don't exist, don't recurse, or only remove empty directories.

Exam trap

The trap is mixing Windows and Linux commands — candidates pick del -r (a Windows-ism) or rmdir, forgetting that only rm -rf performs recursive forced deletion on Linux.

How to eliminate wrong answers

Option B is wrong because rm -d attempts to remove an empty directory (equivalent to rmdir) and will fail if the directory contains files; it does not recurse. Option C is wrong because del is a Windows/DOS command, not a Linux command, and -r is not a valid del option in that context. Option D is wrong because rmdir only removes empty directories and errors out if contents exist, so it cannot remove a directory and all its contents.

180
MCQeasy

Which command provides a brief summary of what a specific command does without opening the entire man page?

A.info
B.whatis
C.man -d
D.apropos
AnswerB

The whatis command queries the manual page database and returns the one-line description stored for a command, satisfying the requirement for a brief summary without opening the full man page. Unlike man, it does not page through the complete documentation.

Why this answer

The whatis command displays the one-line description from the man page database for a given command, providing a brief summary without opening the full manual. It reads from the whatis database created by mandb, making it fast and concise. This is exactly the 'brief summary' behavior the question asks for.

Exam trap

The trap here is confusing whatis (brief summary of one command) with apropos (keyword search across many commands) or info (full GNU documentation); candidates often pick apropos because it also 'describes' commands.

How to eliminate wrong answers

Option A is wrong because info opens the GNU Info documentation system, which is a full hypertext manual, not a brief summary. Option C is wrong because man -d is not a standard option for a summary; man -d is sometimes used for debugging output, and man -k is the actual keyword search. Option D is wrong because apropos searches man page descriptions by keyword and returns multiple matches, rather than summarizing one specific command.

181
MCQmedium

A small design studio wants to deploy a Linux desktop for graphic work but must keep every application they install free to modify and redistribute internally. Which characteristic of a Linux distribution best supports this requirement?

A.The distribution uses a rolling release model with frequent updates.
B.The distribution ships only with open source licenses that permit source code modification and redistribution.
C.The distribution includes a commercial support contract from the vendor.
D.The distribution is released under a proprietary end-user license agreement.
AnswerB

Open source licenses such as GPL, MIT, and Apache grant the rights to study, modify, and redistribute the software. A distribution built entirely from such licensed components lets the studio alter applications and share the changes internally without violating licensing terms, directly fulfilling their requirement.

Why this answer

The studio needs the legal freedom to modify and redistribute the applications they install. Only a distribution composed of open source licensed software grants those rights through licenses like GPL and MIT. Support contracts, release models, and proprietary EULAs affect other aspects but do not provide the required freedoms.

Exam trap

The trap here is confusing commercial support or frequent updates with the legal freedoms granted by open source licenses.

182
MCQmedium

A Linux administrator needs to add a new user account named 'tester' with a home directory and a default shell of /bin/bash. Which command should be used?

A.passwd -a tester -s /bin/bash -d /home/tester
B.adduser tester --shell /bin/bash --home /home/tester
C.useradd -m -s /bin/bash tester
D.usermod -m -s /bin/bash tester
AnswerC

The useradd command with -m creates the home directory and -s sets the login shell to /bin/bash. This matches the requirement to add a user with a home directory and specific shell. The command is standard on most Linux distributions, though some may require additional options for password setting.

Why this answer

The useradd command with -m and -s options creates a new user with a home directory and specified shell. This is the standard method for adding users in a non-interactive script or command line. Other commands like adduser may be distribution-specific or interactive, while usermod and passwd serve different purposes.

Exam trap

The trap here is confusing useradd with usermod or adduser, assuming that any command with 'user' in the name can create accounts, when only useradd (or adduser) is designed for creation.

183
Multi-Selecthard

Which TWO of the following help manage compressed archive contents?

Select 2 answers
A.find
B.cat
C.gzip
D.grep
E.tar
AnswersC, E

gzip compresses single files into .gz archives, satisfying the requirement to manage compressed archive contents. It reduces file size for storage or transfer, though it cannot bundle multiple files together—that needs tar first. For the exam's purpose, gzip is a recognised compression tool that directly handles archive content.

Why this answer

Option C, gzip, is correct because it is the standard GNU/Linux compression utility that compresses and decompresses files (creating .gz archives) and can also list compression information with gzip -l, directly managing compressed archive contents. Option E, tar, is correct because it is the archiving utility that bundles multiple files and directories into a single archive and, when combined with compression options such as -z (gzip), -j (bzip2), or -J (xz), creates and extracts compressed archives like .tar.gz, making it a primary tool for managing compressed archive contents. Option A, find, is incorrect because it searches the filesystem for files matching criteria such as name, size, or permissions; it does not compress, decompress, or manipulate archive contents.

Option B, cat, is incorrect because it concatenates and displays file contents to standard output and has no archive or compression management capability. Option D, grep, is incorrect because it searches text patterns within files and, while it can search inside uncompressed streams, it does not create, extract, or otherwise manage compressed archives.

Exam trap

The trap is conflating compression with archiving — candidates may pick find or grep because they associate them with file handling, missing that only gzip (compress) and tar (archive) manage archive contents.

184
MCQeasy

Which command-line shortcut allows you to autocomplete filenames and commands?

A.Enter
B.Shift + Insert
C.Tab
D.Ctrl + C
AnswerC

Pressing Tab invokes the shell's completion facility, which reads the current partial token and expands it against available commands or filenames in the search path. This satisfies the requirement for a keyboard shortcut that autocompletes both commands and filenames without executing anything.

Why this answer

Pressing the Tab key in a Linux shell triggers the readline completion feature, which autocompletes filenames, directory paths, and command names based on what you have typed so far. If multiple matches exist, pressing Tab twice lists all candidates. This is a core productivity shortcut in bash and most other shells.

Exam trap

The trap is confusing terminal editing shortcuts — candidates sometimes pick Ctrl+C thinking it 'completes' or cancels input, but it actually sends SIGINT to kill the running process.

How to eliminate wrong answers

Option A is wrong because Enter submits the current command line for execution — it does not perform completion. Option B is wrong because Shift+Insert is a terminal emulator shortcut for pasting text from the clipboard (the X11 primary selection), not for autocompletion. Option D is wrong because Ctrl+C sends SIGINT to interrupt and terminate the currently running foreground process — it aborts commands rather than completing them.

185
MCQeasy

Which directory contains the user accounts' password hashes and aging data on most modern Linux systems?

A./etc/shadow
B./etc/passwd
C./var/spool/mail
D./etc/group
AnswerA

On modern Linux systems, /etc/shadow holds the password hashes plus ageing fields such as last-change day and expiry, readable only by root. /etc/passwd retains the placeholder x in its password field, so it no longer carries hashes.

Why this answer

On modern Linux systems, /etc/shadow is the file that stores encrypted password hashes along with password aging information such as the last change date, minimum and maximum password age, and expiration warnings. It is readable only by root, which protects the hashes from unauthorized access. The /etc/passwd file historically held password hashes but now contains only user account information, with the password field replaced by an 'x' that points to /etc/shadow.

Exam trap

The trap here is the common misconception that /etc/passwd still stores password hashes, which was true in early Unix systems but is no longer the case on modern Linux due to security enhancements.

How to eliminate wrong answers

Option B is wrong because /etc/passwd no longer stores password hashes on modern systems; it contains user account details like UID, GID, home directory, and shell, with the password field typically showing 'x' to indicate the hash is in /etc/shadow. Option C is wrong because /var/spool/mail is the directory for user mailboxes, not password or aging data. Option D is wrong because /etc/group defines group memberships and does not contain password hashes or aging information for user accounts.

186
MCQmedium

A technician needs to locate every file under '/usr/share' whose name ends with '.conf'. Which command produces this list by searching the directory tree?

A.which '*.conf' /usr/share
B.find /usr/share -name '*.conf'
C.locate '/usr/share/*.conf'
D.grep -r '/usr/share' '*.conf'
AnswerB

find /usr/share starts at the given directory and recursively descends the tree. The -name test matches the final path component against the shell-style pattern '*.conf', returning every matching file. Quoting prevents the shell from expanding the pattern prematurely. This is the canonical, reliable method for locating files by name pattern within a directory hierarchy.

Why this answer

Searching a directory tree for files by name pattern is the purpose of find with the -name test. The which command only checks PATH executables, locate relies on a possibly stale database and does not handle anchored globs the same way, and grep examines file contents rather than names. Quoting the pattern ensures the shell passes it literally to find.

Exam trap

The trap here is confusing tools that search file contents, like grep, or databases, like locate, with tools that walk the filesystem tree by name.

187
MCQmedium

While exploring a system, an administrator runs `ls -a` inside a directory and sees entries named `.` and `..` in addition to regular files. What do these two entries represent?

A.Symbolic links pointing to the filesystem root
B.Hidden configuration files created by the user
C.Temporary files scheduled for deletion by the system
D.The current directory and its parent directory
AnswerD

In every directory, `.` is a hard link to the directory itself, and `..` is a hard link to its parent. They appear only when hidden entries are listed, which is why `ls -a` reveals them. These entries make relative navigation possible, so a command like `cd ..` works without knowing the parent's name. The root directory's `..` points back to root itself.

Why this answer

The single dot is a reference to the directory containing it, and the double dot references that directory's parent. Both are ordinary directory entries maintained by the filesystem, hidden from default listings because their names begin with a dot. They underpin relative path resolution, allowing commands to address the current or parent directory without spelling out full absolute paths.

Exam trap

The trap here is treating `.` and `..` as hidden user files rather than as built-in directory references that govern relative navigation.

188
MCQhard

A contractor needs to run a diagnostic script that requires reading a log file owned by `root` with mode `640` and group `adm`. The contractor's account `contractor` has primary group `contractor` but has been added as a supplementary member of `adm`. Which statement describes what will happen when the contractor attempts to read the file?

A.The read fails because the file is owned by root and the others class has no read permission.
B.The read succeeds because supplementary group membership is honored, and the group read bit applies to the adm group.
C.The read fails because only the primary group is considered when evaluating the group permission class.
D.The read succeeds only if the contractor first runs newgrp adm to switch the primary group for the session.
AnswerB

Linux evaluates a process's group set, which includes the primary group plus all supplementary groups. Since contractor is a supplementary member of adm and the file grants read to its group adm, the access check passes. The owner class does not apply, and the others class has no read bit, but the group class matches.

Why this answer

Permission evaluation walks the owner, group, and others classes in order and stops at the first match. Because the contractor is a supplementary member of adm and the file grants read to group adm, the group class applies and access is allowed. Primary group switching or owner identity considerations do not change the outcome in this setup.

Exam trap

The trap here is believing that only the primary group counts for the group permission class, when supplementary memberships are equally valid.

189
MCQmedium

If you want to view a long text file page by page, which command is most suitable?

A.tail filename
B.less filename
C.cat filename
D.grep filename
AnswerB

less opens the file in a pager, letting you scroll forward and backward through long content one screen at a time without loading everything into memory. It also supports searching, unlike cat, which dumps the entire file at once.

Why this answer

The less command is a pager that displays a file one screenful at a time, allowing the user to scroll forward and backward with arrow keys, Page Up/Down, and search with '/'. It reads the file lazily and does not load the entire content into memory, making it ideal for viewing long text files interactively. This is the canonical tool for page-by-page file inspection on Linux.

Exam trap

The trap is that cat and less both 'show' a file, but only less paginates — candidates who equate 'view a file' with cat pick the wrong tool, forgetting that cat floods the terminal.

How to eliminate wrong answers

Option A is wrong because tail only shows the last 10 lines by default (or a specified number with -n), not the whole file page by page. Option C is wrong because cat concatenates and dumps the entire file to standard output at once, scrolling past the terminal without pausing. Option D is wrong because grep searches for patterns within files and prints matching lines; it is not a pager and does not display files page by page.

190
MCQhard

A technician needs to locate all files under /var that are larger than 100 MB and were modified more than 30 days ago. Which command will produce this list?

A.ls -lS /var | grep +100M
B.locate -size +100M -mtime +30 /var
C.find /var -size 100M -mtime 30
D.find /var -size +100M -mtime +30
AnswerD

The find command with -size +100M matches files larger than 100 megabytes, and -mtime +30 matches files whose data was last modified more than 30 days ago. Together they filter exactly the requested files under /var. This is the standard and correct syntax for combining size and modification time criteria in a single find invocation.

Why this answer

The find command is designed for filesystem searches based on metadata such as size and modification time. Using -size +100M and -mtime +30 correctly selects files larger than 100 MB and older than 30 days. Other tools like locate lack metadata filters, ls does not recurse or filter, and omitting the plus signs changes the meaning to exact matches, which would not return the intended set of files.

Exam trap

The trap here is forgetting that find treats numeric arguments without a leading plus as exact matches, so -mtime 30 means exactly 30 days, not more than 30 days.

191
MCQmedium

A small business owner wants to replace a proprietary office suite with a free alternative on Linux workstations. A consultant explains that the software can be used, studied, modified, and redistributed. Which concept is the consultant describing?

A.Free software
B.Software as a Service (SaaS)
C.Public domain software
D.Shareware
AnswerA

Free software is defined by the freedom to run, study, modify, and redistribute the program, which is exactly what the consultant described. The term 'free' refers to liberty, not price, and aligns with the business owner's goal of replacing proprietary software on Linux workstations while retaining those freedoms.

Why this answer

Free software is defined by four freedoms: running, studying, modifying, and redistributing the program. The consultant's description matches this definition precisely, while SaaS, shareware, and public domain software each lack one or more of those guarantees or operate under different legal models.

Exam trap

The trap here is confusing 'free' with 'no cost' and selecting shareware or public domain software instead of the freedom-based definition.

192
MCQeasy

Which character is used to append output to an existing file without deleting its original content?

A.<
B.|
C.>
D.>>
AnswerD

The double chevron opens the target file in append mode, positioning the write offset at end-of-file so existing content survives. A single chevron would truncate instead, so >> satisfies the requirement to preserve original content.

Why this answer

The >> operator redirects standard output and appends it to the end of an existing file, preserving the original content. This is the standard shell redirection for adding data without truncation. The single > would overwrite the file, and the other symbols perform input redirection or piping, not appending.

Exam trap

The trap is confusing > with >> — candidates who know redirection exists but forget that a single > truncates the file, destroying existing content.

How to eliminate wrong answers

Option A is wrong because < is the input redirection operator, feeding a file's contents as standard input to a command, not writing output. Option B is wrong because | is the pipe operator, which sends the standard output of one command to the standard input of another, not to a file. Option C is wrong because > redirects output but truncates/overwrites the target file, destroying existing content — the opposite of appending.

193
MCQmedium

A firm wants to contribute back to the open source community to improve their internal Linux tools. What is the best practice for submitting these improvements?

A.Post the code on a private internal company wiki.
B.Rename the software and sell it as a proprietary product.
C.Fork the code and never release the changes publicly.
D.Submit patches or pull requests to the original project's repository.
AnswerD

Submitting patches or pull requests to the original project's repository is the standard open source contribution route, satisfying the stem's requirement to improve internal Linux tools by feeding changes upstream. This lets maintainers review, discuss and merge your work, keeping the project's single canonical codebase intact rather than fragmenting it into private forks.

Why this answer

The best practice for contributing improvements back to an open source project is to submit patches or pull requests to the original project's repository. This allows the maintainers to review, test, and merge the changes, ensuring the improvements benefit the entire community and are maintained in future releases. It also respects the project's governance and licensing.

Exam trap

The trap is thinking that keeping changes internal or forking privately is a valid contribution — candidates may pick options that seem convenient but do not actually give back to the community, which is the core of the question.

How to eliminate wrong answers

Option A is wrong because posting code on a private internal wiki does not contribute back to the community — it keeps the improvements siloed and unavailable to others. Option B is wrong because renaming and selling the software as proprietary violates the spirit of open source and may breach the license terms, especially for copyleft licenses. Option C is wrong because forking and never releasing changes publicly is the opposite of contributing back — it creates a dead-end fork that does not benefit the upstream project.

194
MCQmedium

A teammate wants to search a large text file for lines containing the word 'error', ignoring case, and display the matching line numbers. Which command accomplishes this?

A.grep -l error filename.txt
B.grep -v error filename.txt
C.grep -in error filename.txt
D.grep -c error filename.txt
AnswerC

The -i flag makes matching case-insensitive, and -n prefixes each matching line with its line number. Combined, they satisfy both requirements in one pass over the file. Without -i, only lowercase occurrences would match; without -n, no line numbers would appear, so both flags are needed together.

Why this answer

grep options compose to refine output: -i removes case sensitivity so Error and ERROR match, while -n annotates each result with its line number in the file. Supplying both flags in a single invocation produces exactly the requested listing. Other flags such as -c, -v, and -l change the output in ways that do not satisfy this scenario.

Exam trap

The trap here is selecting a count or file-list flag when the requirement is to display the matching lines themselves with their positions in the file.

195
MCQeasy

A user wants to view the permissions of all files in a directory, including hidden files, in a long listing format. Which command should they use?

A.ls -l
B.ls -lh
C.ls -la
D.ls -a
AnswerC

The command ls -la combines the -l (long format) and -a (all files) options, providing a detailed listing that includes permissions, ownership, size, and modification time for all files, including hidden ones. This is the correct command to view permissions of all files in a directory, including hidden files, in a long listing format.

Why this answer

To view permissions of all files, including hidden ones, in a long listing format, the ls command needs both the -l and -a options. The -l option provides detailed information such as permissions, ownership, and size, while -a ensures that hidden files (those starting with a dot) are included. Combining them as ls -la achieves the desired output.

Exam trap

The trap here is forgetting that hidden files are not shown by default and that the -a option is required in addition to -l to see them.

196
MCQmedium

Your organization wants to standardize its servers on a single distribution to streamline patch management. Which of the following is an advantage of using a major distribution like Ubuntu LTS or RHEL?

A.They allow administrators to compile the kernel from source code during every boot.
B.They always include the latest experimental features from the Linux kernel.
C.They are guaranteed to be smaller in size compared to community distributions.
D.They provide predictable support lifecycles and stable software versions.
AnswerD

Major distributions such as Ubuntu LTS and RHEL publish long, predictable support windows with security backports, letting the firm standardise patching schedules and rely on stable, tested package versions rather than chasing frequent upstream releases.

Why this answer

Major enterprise distributions such as Ubuntu LTS and RHEL offer long, predictable support lifecycles (e.g., 5-10 years) with stable, tested software versions, which is exactly what organizations need for consistent patch management. This stability reduces the risk of regressions from frequent upstream changes. The other options describe characteristics that are either false or undesirable for production servers.

Exam trap

010-160 often tests the misconception that newer or 'latest' software equals better, so candidates may wrongly pick the option about experimental kernel features instead of recognizing that enterprise distributions prioritize stability and long support lifecycles.

How to eliminate wrong answers

Option A is wrong because compiling the kernel from source at every boot is impractical, slow, and not a feature of major distributions. Option B is wrong because enterprise distributions deliberately lag behind the bleeding edge, prioritizing stability over experimental kernel features. Option C is wrong because major distributions are not guaranteed to be smaller than community distributions; size depends on packaging and included software, not on the distribution's enterprise status.

197
Multi-Selecthard

Which TWO of the following are differences between a community-driven and a vendor-supported Linux distribution?

Select 2 answers
A.The usage of open source software
B.The ability to run on x86 hardware
C.Predictability of release cycles
D.Commercial support availability
E.Kernel development capability
AnswersC, D

Vendor-supported distributions, such as Red Hat Enterprise Linux, follow fixed, published release and support lifecycles, giving organisations predictable upgrade windows. Community-driven distributions typically release when ready, with irregular cadences. This satisfies the stem's predictability criterion, since commercial backing funds dedicated release engineering and long-term maintenance commitments.

Why this answer

Option C is correct because community-driven distributions such as Debian or Arch typically follow their own volunteer-paced release schedules (or rolling releases), whereas vendor-supported distributions like RHEL or Ubuntu LTS commit to published, predictable lifecycles and release cadences backed by a company. Option D is correct because vendor-supported distributions offer commercial support contracts, SLAs, and certified hardware/software ecosystems from the vendor, while community-driven distributions rely on forums, mailing lists, and community volunteers rather than paid enterprise support. Options A and B are not differences because both community and vendor distributions are built predominantly on open source software and both commonly run on x86 (and x86-64) hardware.

Option E is not a distinguishing difference because kernel development is an upstream, community-wide effort that both types of distributions consume and contribute to, rather than a defining split between them.

Exam trap

The trap here is conflating 'open source' or 'kernel development' with the support model — candidates assume vendor distros are less open or that community distros cannot develop kernels, when the real differentiators are release predictability and commercial support.

198
MCQeasy

A junior administrator needs to change the ownership of the file `/var/www/html/index.html` from user `deploy` to user `www-data`, while leaving the group ownership and all permission bits exactly as they are. Which command should be used?

A.chgrp www-data /var/www/html/index.html
B.chown www-data:www-data /var/www/html/index.html
C.chown www-data /var/www/html/index.html
D.chmod www-data /var/www/html/index.html
AnswerC

When chown is given a single name without a colon or dot, that name is interpreted as the new owner and the group is left unchanged. Permission bits are also untouched. This matches the requirement precisely: only the owning user changes to www-data, with group ownership and mode preserved.

Why this answer

The chown command changes file ownership, and when only a user name is supplied, the group is preserved. Using the colon form would change both owner and group, violating the requirement. The chmod and chgrp commands address permissions and group ownership respectively, so neither can fulfill the stated ownership change.

Exam trap

The trap here is treating chown and chgrp as interchangeable, when only chown can change the owning user and only the colon form alters the group.

199
MCQmedium

You are using the 'less' command to view a large log file. Which key do you press to search forward for a specific string?

A.?
B./
C.q
D.n
AnswerB

Within the pager, pressing / opens a forward search prompt, letting you type a string and jump to its next occurrence in the log. This satisfies the requirement to search forward through the file's contents without leaving less.

Why this answer

In the 'less' pager, pressing '/' initiates a forward search for a specified string. After typing the pattern and pressing Enter, 'less' highlights all matches and jumps to the first occurrence after the current position. This is consistent with the vi/vim editor's search behavior, which 'less' mimics for user familiarity.

Exam trap

The trap here is confusing the forward search key '/' with the backward search key '?', as both are used for searching but in opposite directions; candidates often mix them up under pressure.

How to eliminate wrong answers

Option A is wrong because '?' is used for backward search in 'less', not forward search. Option C is wrong because 'q' quits the 'less' program entirely, returning to the shell. Option D is wrong because 'n' repeats the previous search in the same direction, but it does not initiate a new search.

200
Multi-Selecthard

Which TWO of the following are valid ways to create a directory?

Select 2 answers
A.touch
B.install -d
C.mkdir
D.ln
E.cp -d
AnswersB, C

The install command's -d flag creates each named directory plus any missing parent directories, mirroring mkdir -p behaviour. This satisfies the stem's requirement for a valid directory-creation method, since install -d is a documented GNU coreutils option that builds the full path in one invocation.

Why this answer

Option C, mkdir, is correct because mkdir is the standard Linux command whose sole purpose is to create directories (e.g., mkdir /path/to/dir), and it can create intermediate directories with the -p flag. Option B, install -d, is correct because install with the -d (directory) option creates each specified directory along with any missing parent directories, commonly used in scripts and Makefiles to create destination directories with controlled permissions. The unmarked options do not belong: touch creates or updates empty files (not directories), ln creates hard or symbolic links, and cp -d preserves symbolic links during a copy rather than creating a directory.

Exam trap

The trap is that `install` sounds like it only installs software, so candidates dismiss `install -d` — but on Linux it is a coreutils command that creates directories with explicit attributes.

201
MCQeasy

A user wants to check the amount of free disk space on all mounted filesystems in a human-readable format. Which command should they use?

A.du -h
B.df -h
C.free -h
D.lsblk -f
AnswerB

df -h displays disk space usage for all mounted filesystems in human-readable units (e.g., GB, MB). This directly answers the user's need to see free space in an easily understandable format. It is the standard command for this purpose and is available on virtually all Linux systems.

Why this answer

df -h is the correct command to display free disk space on mounted filesystems in a human-readable format. It summarizes total, used, and available space per filesystem. Other commands like du, free, and lsblk serve different purposes, such as directory usage, memory usage, and block device listing, respectively.

Exam trap

The trap here is confusing disk space commands: du shows directory usage, free shows memory, and lsblk shows block devices, while only df shows filesystem free space.

202
MCQmedium

You need to set an environment variable named 'MYVAR' to 'hello' so that it is available to child processes. Which command is correct?

A.set MYVAR=hello
B.MYVAR=hello
C.env MYVAR=hello
D.export MYVAR=hello
AnswerD

The export builtin marks MYVAR for inclusion in the environment of subsequently executed commands, so child processes inherit it. Assigning without export would create only a shell variable, invisible to children, failing the stem's inheritance requirement.

Why this answer

The export builtin marks a shell variable for inclusion in the environment of subsequently executed child processes. Writing export MYVAR=hello both assigns the value and exports it in one step, making it visible to programs launched from that shell. Without export, the variable would remain a shell-local variable and would not be inherited by child processes.

Exam trap

The trap is treating plain assignment (MYVAR=hello) as sufficient for child-process visibility; candidates forget that export is what promotes a shell variable into the inherited environment.

How to eliminate wrong answers

Option A is wrong because set MYVAR=hello is not valid Bash syntax for assignment; set is used to set shell options or positional parameters, and this form would not create the variable correctly. Option B is wrong because MYVAR=hello alone creates a shell variable but does not export it, so child processes would not see it. Option C is wrong because env MYVAR=hello runs the command 'MYVAR=hello' as a program (which does not exist) rather than setting a persistent variable; env is used to run a command with a modified environment, not to define a variable for the current shell.

203
MCQhard

When considering a career in Linux system administration, which certification path demonstrates proficiency in managing system-level services and security across diverse distributions?

A.LPIC-1: Linux Administrator
B.AWS Certified SysOps Administrator
C.Red Hat Certified System Administrator (RHCSA)
D.Cisco Certified Network Associate (CCNA)
AnswerA

LPIC-1 from the Linux Professional Institute is distribution-neutral: its two exams cover system architecture, package management with both Debian and Red Hat tools, the command line, filesystems, scripting, user administration, essential services, networking and security basics. Passing shows you can administer Linux whichever distribution an employer uses, which is the key phrase in the question. Linux Essentials, this exam, is the natural step before it.

Why this answer

LPIC-1: Linux Administrator is a distribution-neutral certification that validates proficiency in managing Linux system-level services, security, and administration across diverse distributions like Debian, Red Hat, and SUSE. It is specifically designed to demonstrate vendor-independent Linux skills, making it the best fit for the question's emphasis on 'diverse distributions.' The LPIC-1 exam covers topics such as package management, filesystem management, user administration, and networking.

Exam trap

The trap is confusing vendor-specific certifications (RHCSA) with distribution-neutral ones (LPIC-1) — candidates may pick RHCSA because it is well-known, but the question specifically asks for proficiency across diverse distributions.

How to eliminate wrong answers

Option B is wrong because AWS Certified SysOps Administrator is a cloud-specific certification focused on AWS services, not general Linux system administration across distributions. Option C is wrong because RHCSA is a Red Hat-specific certification that, while valuable, is tied to Red Hat Enterprise Linux and does not demonstrate cross-distribution proficiency. Option D is wrong because CCNA is a networking certification focused on Cisco routing and switching, not Linux system administration.

204
MCQmedium

A startup company is deciding between a Community-driven distribution and an Enterprise distribution. Which scenario best justifies choosing an Enterprise distribution?

A.The development team wants zero cost for the distribution and documentation.
B.The company needs long-term stability and guaranteed vendor support for critical infrastructure.
C.The company wants to actively contribute to the kernel source code directly.
D.The project requires the absolute latest software features released daily.
AnswerB

Enterprise distributions supply extended maintenance, certified packages, and vendor-backed support contracts, which critical infrastructure demands. Community distributions lack guaranteed support lifecycles, so the need for long-term stability and accountable vendor assistance justifies the Enterprise choice.

Why this answer

Enterprise distributions (e.g., RHEL, SLES) provide long-term support lifecycles, certified hardware/software stacks, and vendor-backed SLAs — exactly what critical infrastructure needs. A startup running production systems that cannot tolerate unscheduled breakage should choose an Enterprise distro to get guaranteed security patches and support channels. This directly matches the requirement for stability and vendor accountability.

Exam trap

The trap is equating 'free' with 'better for business'; candidates may pick the zero-cost Community option, forgetting that Enterprise value lies in support SLAs and lifecycle guarantees, not price.

How to eliminate wrong answers

Option A is wrong because zero cost is a characteristic of Community distributions (e.g., Fedora, Debian), not a justification for Enterprise; Enterprise distros typically require a subscription. Option C is wrong because contributing directly to kernel source is independent of distribution choice — anyone can submit patches upstream regardless of which distro they run. Option D is wrong because daily latest features describe a rolling-release Community distro (e.g., Arch, Fedora Rawhide), which is the opposite of the stability Enterprise distros prioritize.

205
MCQmedium

A university lab is choosing a license for a new data-analysis tool developed by students. The lab wants other researchers to be able to use, modify, and redistribute the tool, but also wants any modified versions distributed to others to remain open source. Which licensing approach best fits these goals?

A.Release the tool under a copyleft license such as GPLv3, which requires distributed modified versions to remain under the same license.
B.Release the tool as public domain, which removes all copyright and thus requires all future versions to be open source.
C.Keep the tool proprietary but publish documentation under a Creative Commons license so researchers can read about the methods.
D.Release the tool under a permissive license such as BSD 3-Clause, which allows modified versions to be redistributed under proprietary terms.
AnswerA

A copyleft license such as GPLv3 allows use, modification, and redistribution, but requires that distributed derivative works be licensed under the same terms and include source code. This matches the lab's dual goal of openness and ensuring modified versions shared with others remain open source, while still permitting broad academic and commercial use.

Why this answer

The lab wants broad freedom to use and modify the tool, plus a guarantee that distributed modified versions stay open source. A copyleft license such as GPLv3 provides exactly that combination by requiring derivative distributions to carry the same license and source availability. Permissive licenses and public domain would allow proprietary derivatives, which conflicts with the lab's second goal.

Exam trap

The trap here is assuming that any open source license guarantees modified versions remain open source; only copyleft licenses impose that reciprocal condition on distribution.

206
MCQeasy

A helpdesk technician is asked to confirm which Linux kernel is currently running on a production web server so they can compare it against a vendor's supported-kernel list. They only have a standard shell session and want the most direct command that prints the running kernel release string. Which command should they use?

A.cat /etc/os-release
B.lscpu
C.lsmod
D.uname -r
AnswerD

The uname command reports system information, and its -r option prints only the kernel release string of the currently running kernel, such as 5.15.0-91-generic. Because it reads the live kernel rather than a file, it reflects exactly what is loaded in memory right now, which is what the technician needs to compare against the vendor's supported-kernel list.

Why this answer

The uname utility queries the running kernel itself, and the -r flag narrows the output to the kernel release string. That live value is authoritative because it reflects the kernel currently booted, not merely the newest kernel package installed on disk. The other commands report distribution metadata, loaded modules, or processor details, none of which identify the running kernel release.

Exam trap

The trap here is assuming that the distribution version file or the newest installed kernel package tells you which kernel is actually running after an upgrade without a reboot.

207
MCQeasy

A user has a file named notes.txt in /home/alex and wants to create a copy named notes_backup.txt in the same directory without altering the original. Which command accomplishes this?

A.ln notes.txt notes_backup.txt
B.cp notes.txt notes_backup.txt
C.cat notes.txt > notes_backup.txt
D.mv notes.txt notes_backup.txt
AnswerB

The cp command copies the contents of the source file to a new destination file, leaving the original notes.txt untouched. This directly satisfies the requirement of creating notes_backup.txt in the same directory while preserving the original file for continued use.

Why this answer

Copying a file while keeping the original is exactly what cp does. The syntax cp source destination creates a new file with the same content and leaves the source in place. Renaming with mv, linking with ln, or redirecting with cat either removes the original name, shares the same inode, or lacks the robustness of a dedicated copy utility.

Exam trap

The trap here is confusing moving with copying, since mv also takes two filenames and appears to produce a new file, but it removes the original name.

208
MCQeasy

A junior administrator is at a shell prompt in /home/alex and wants to see a compact, one-line-per-entry listing that includes hidden files along with their permissions and sizes. Which command accomplishes this?

A.ls -i
B.ls -R
C.ls -d
D.ls -la
AnswerD

The -l flag produces a long listing showing permissions, ownership, size, and modification time, while -a includes entries beginning with a dot such as .bashrc. Running this from /home/alex gives exactly the compact one-line-per-entry view the administrator requested, including hidden files.

Why this answer

A long listing is produced with -l, and hidden entries are included with -a. Combining the two flags gives permissions, ownership, size, timestamps, and dotfiles in a single-column format, which matches the administrator's goal of inspecting everything in the current directory without recursion or extra inode data.

Exam trap

The trap here is assuming that a plain ls already shows hidden dotfiles, when only the -a flag adds them.

209
MCQeasy

A student is preparing for a career as a Linux system administrator and wants to understand the difference between a Linux distribution and the Linux kernel. Which statement best describes the relationship?

A.A distribution is the core of the operating system, and the Linux kernel is an optional add-on that provides a graphical interface.
B.The Linux kernel is the core of the operating system, and a distribution packages the kernel with utilities, libraries, and a package manager to form a complete system.
C.The Linux kernel and a distribution are the same thing, but distributions are sold commercially while the kernel is free.
D.A distribution is a proprietary version of the kernel that vendors customize for their hardware, while the kernel is only used in embedded devices.
AnswerB

The kernel manages hardware, processes, and memory, while a distribution adds user-space tools, libraries, a desktop or server environment, and a package manager. This combination makes a usable operating system. The statement accurately captures the relationship and is essential knowledge for an aspiring administrator.

Why this answer

The Linux kernel is the low-level core that interacts with hardware and manages resources. A distribution builds on the kernel by adding user-space utilities, libraries, a package manager, and often a desktop environment. This distinction is fundamental for anyone pursuing a Linux administration career, as it clarifies where responsibilities lie.

Exam trap

The trap here is treating the kernel and a distribution as interchangeable, which overlooks the many user-space components that make a system usable.

210
Multi-Selecthard

Which THREE of the following are typical elements included in a standard Linux distribution package?

Select 3 answers
A.Package Manager
B.Base libraries and utilities
C.Proprietary BIOS firmware
D.Linux Kernel
E.Hardware warranty certificate
AnswersA, B, D

A package manager is a core component of a standard Linux distribution, providing dependency resolution, installation, upgrade and removal of software from configured repositories. It satisfies the stem's requirement for typical distribution elements, alongside the kernel and desktop environment, by automating software lifecycle management rather than requiring manual compilation.

Why this answer

A standard Linux distribution package typically includes a Package Manager (A), such as APT, DNF, or Pacman, which is essential for installing, updating, and removing software and resolving dependencies. It also includes base libraries and utilities (B), like glibc, coreutils, and system tools, which provide the fundamental runtime and command-line environment for the system. The Linux Kernel (D) is a core component, as it manages hardware, processes, memory, and system calls, and every distribution ships a kernel (often with multiple versions or modules).

Proprietary BIOS firmware (C) is not included because BIOS/UEFI firmware is vendor-specific and resides on the motherboard, not in a distribution's package set. A hardware warranty certificate (E) is a physical or vendor document unrelated to the software contents of a Linux distribution.

Exam trap

010-160 often tests whether candidates confuse hardware/vendor artifacts (BIOS, warranty) with software distribution components — the trap is picking anything that sounds 'system-level' but is actually hardware.

211
MCQmedium

When using 'man', what does the section number '5' refer to?

A.User commands
B.File formats
C.System calls
D.Kernel routines
AnswerB

Section 5 of the manual documents file formats and conventions, such as /etc/passwd or proc file layouts, rather than commands or system calls. It is the section consulted when you need the structure of a configuration or data file.

Why this answer

In the Linux man page section scheme, section 5 is reserved for file formats and conventions (e.g., /etc/passwd, /etc/fstab). Section 1 is user commands, section 2 is system calls, and section 3 is library functions. Knowing the section numbers lets you disambiguate pages like 'passwd' (1 vs 5).

Exam trap

The trap is confusing section 5 (file formats) with section 2 (system calls) or section 3 (library functions) — candidates often assume '5' refers to something more technical like kernel routines.

How to eliminate wrong answers

Option A is wrong because user commands are section 1 (e.g., man 1 ls). Option C is wrong because system calls are section 2 (e.g., man 2 open). Option D is wrong because kernel routines are also covered under section 2 (system calls) or section 9 on some systems (kernel developer docs), not section 5.

212
MCQmedium

While exploring a Linux system, a new administrator runs `ls -l /etc/shadow` and sees that the file is owned by root and group shadow, with permissions `rw-r-----`. They want to understand which user accounts on the system are currently configured with a valid password hash versus those that are locked. Which command best lists only the accounts that have a real password hash set in `/etc/shadow`?

A.sudo cut -d: -f1,2 /etc/shadow | grep -v '^root'
B.sudo passwd -S -a | grep ' P '
C.sudo awk -F: 'length($2) > 1 && $2 !~ /^[!*]/ {print $1}' /etc/shadow
D.sudo grep -v '^#' /etc/passwd | cut -d: -f1
AnswerC

This awk command reads /etc/shadow with colon as the field separator. Field 2 holds the password hash. The condition length($2) > 1 excludes empty or single-character entries, and the regex !~ /^[!*]/ excludes locked accounts whose hash field starts with ! or *. Only accounts with an actual hash are printed, exactly matching the scenario.

Why this answer

The shadow file stores the password hash in the second colon-separated field. Accounts with a real hash have a string that is neither empty nor beginning with ! or *. The awk expression tests the length and the first character of that field, so it returns only usernames whose password hash is actually set.

Reading /etc/shadow directly is also the authoritative method, since /etc/passwd no longer holds the hash on modern systems.

Exam trap

The trap here is assuming that /etc/passwd still contains password hashes, when on modern Linux systems the actual hash is stored in /etc/shadow and the passwd file only shows a placeholder.

213
MCQmedium

You wish to send the output of the 'ls -l' command directly into a file named 'dirlist.txt', overwriting any existing content. Which operator should you use?

A.ls -l > dirlist.txt
B.ls -l | dirlist.txt
C.ls -l >> dirlist.txt
D.ls -l < dirlist.txt
AnswerA

The > redirection operator sends stdout to dirlist.txt, truncating and overwriting any existing content, exactly as the scenario requires. The shell opens the file for writing before executing ls, so prior contents are discarded rather than appended.

Why this answer

The single greater-than operator (>) redirects standard output to a file, creating the file if it does not exist or truncating and overwriting it if it does. Therefore 'ls -l > dirlist.txt' writes the directory listing into dirlist.txt, replacing any prior content. This is the standard POSIX shell redirection for overwrite semantics.

Exam trap

The trap is confusing > (overwrite) with >> (append), or mixing up input (<) and output (>) redirection — candidates often pick >> thinking it 'sends' output when it actually appends.

How to eliminate wrong answers

Option B is wrong because the pipe (|) connects the stdout of ls -l to the stdin of another command, but 'dirlist.txt' is a filename, not an executable, so the shell would attempt to run it as a command and fail. Option C is wrong because >> is the append operator, which adds to the end of the file rather than overwriting existing content as the question requires. Option D is wrong because < is the input redirection operator, which feeds dirlist.txt as stdin to ls -l — the opposite direction of what is needed, and ls does not read filenames from stdin anyway.

214
MCQhard

A system administrator is troubleshooting a Linux server that has become unresponsive. The administrator wants to view a snapshot of all currently running processes, including those not attached to a terminal, along with their process IDs and CPU usage. Which command should the administrator use?

A.pstree
B.jobs
C.ps aux
D.top
AnswerC

The ps aux command produces a snapshot of all running processes, including those not attached to a terminal, and displays details such as user, PID, CPU percentage, memory usage, and the command line. It is the standard tool for capturing a static list of processes on a Linux system. This directly satisfies the administrator's need to inspect all processes with their PIDs and CPU usage during troubleshooting.

Why this answer

The ps aux command generates a static snapshot of all processes on the system, including those without a controlling terminal, and shows PID, CPU usage, memory usage, and other details. This matches the administrator's requirement to inspect all running processes with their identifiers and processor utilization. The other commands either provide live updates, cover only shell jobs, or emphasize process hierarchy over resource metrics.

Exam trap

The trap here is assuming that a real-time monitor like top is always the best tool, when the requirement is specifically for a one-time snapshot of all processes.

215
MCQeasy

A helpdesk technician is asked to install a Linux distribution on a spare workstation for a new employee who needs a full desktop environment. The technician wants to minimize the time spent selecting packages during installation. Which type of Linux distribution should the technician choose?

A.A source-based distribution such as Gentoo
B.A full desktop-oriented distribution such as Ubuntu Desktop or Fedora Workstation
C.A minimal server distribution such as Debian netinst or AlmaLinux minimal
D.A live-only distribution such as Knoppix without an installer
AnswerB

Desktop-oriented distributions ship with a preconfigured graphical environment and a curated set of common applications, so the installer makes most package decisions automatically. This directly satisfies the requirement to minimize time spent selecting packages. Ubuntu Desktop and Fedora Workstation are mainstream examples that provide a complete desktop out of the box, making them appropriate for a new employee's workstation.

Why this answer

Desktop-oriented distributions bundle a graphical environment and common applications, so the installer handles most package selection automatically. This minimizes the technician's manual choices and delivers a ready-to-use workstation for the new employee. Source-based, minimal, and live-only options either require extensive manual package selection or do not provide a persistent full desktop installation.

Exam trap

The trap here is assuming that any Linux distribution can be installed quickly with a desktop, when minimal and source-based distributions require substantial manual package selection.

216
MCQhard

You are managing a directory shared by a project team. You want all files created in this directory to automatically belong to the 'developers' group, regardless of the user's primary group. Which command achieves this?

A.usermod -aG developers
B.chgrp developers /data
C.chmod g+s /data
D.chmod 1777 /data
AnswerC

chmod g+s sets the setgid bit on the directory, so newly created files inherit the directory's group (developers) rather than the creator's primary group. This satisfies the stem's requirement that all files automatically belong to the developers group regardless of the user's primary group.

Why this answer

`chmod g+s /data` sets the setgid (SGID) bit on the directory. When SGID is set on a directory, any file or subdirectory created inside inherits the directory's group ownership instead of the creating user's primary group. This is exactly the behavior needed for a shared 'developers' group directory.

Exam trap

The trap is confusing SGID on a directory (group inheritance for new files) with SGID on an executable (run with the file's group privileges) — candidates pick `chgrp` thinking changing the directory's group is enough.

How to eliminate wrong answers

Option A is wrong because `usermod -aG developers` adds a user to the developers supplementary group — it changes group membership but does not affect the group ownership of newly created files in /data. Option B is wrong because `chgrp developers /data` changes the group owner of the directory itself but does not propagate that group to files created inside it. Option D is wrong because `chmod 1777 /data` sets the sticky bit (like /tmp) with world-writable permissions, which prevents users from deleting others' files but does not enforce group inheritance.

217
MCQeasy

Which command is used to display lines of a file that match a pattern, while ignoring case?

A.grep -v
B.grep -w
C.grep -r
D.grep -i
AnswerD

The -i flag makes grep perform case-insensitive matching, so patterns match regardless of upper or lower case letters. Combined with grep's default line-matching behaviour, it displays every line containing the pattern without regard to casing.

Why this answer

The 'grep -i' option performs a case-insensitive pattern match, so lines containing 'Error', 'error', or 'ERROR' all match a search for 'error'. This is the standard way to search files while ignoring letter case. The -i flag is documented in the grep man page as 'ignore case distinctions in patterns and input data'.

Exam trap

010-160 often tests the difference between grep flags — candidates confuse -i (ignore case) with -v (invert), -w (whole word), and -r (recursive), so they must map each flag to its exact behavior.

How to eliminate wrong answers

Option A is wrong because 'grep -v' inverts the match, printing lines that do NOT contain the pattern — the opposite of what is needed. Option B is wrong because 'grep -w' matches only whole words, ensuring the pattern is bounded by non-word characters; it does not affect case sensitivity. Option C is wrong because 'grep -r' performs a recursive search through directories, which changes the scope of the search, not the case handling.

218
Multi-Selecteasy

Which TWO of the following directories are usually located at the root of a Linux filesystem?

Select 2 answers
A./etc
B./users
C./windows
D./programs
E./bin
AnswersA, E

/etc sits directly at the filesystem root and holds host-specific configuration files such as passwd, fstab and service configs. This satisfies the stem's requirement for a directory usually located at the root, distinguishing it from nested paths like /usr/bin or /var/log.

Why this answer

Option A, /etc, is correct because it is a standard top-level directory directly under the root (/) in the Filesystem Hierarchy Standard, holding system-wide configuration files such as /etc/passwd and /etc/fstab. Option E, /bin, is also correct because it is a conventional root-level directory containing essential user command binaries like ls, cp, and bash (often symlinked to /usr/bin on modern distributions). The unmarked options do not belong: /users is not a standard FHS root directory (user home directories live under /home), while /windows and /programs are Windows-style paths with no place in a Linux filesystem hierarchy.

Exam trap

The trap is choosing Windows- or macOS-style directory names (/users, /programs, /windows) that feel familiar but violate the Linux FHS — candidates must recall the actual standard top-level directories.

219
Multi-Selectmedium

A small business is selecting open source software for its accounting and customer management needs. The owner wants to understand common characteristics of open source projects and their communities. (Choose two.)

Select 2 answers
A.All open source projects are legally required to provide free technical support to every user.
B.The source code is typically available for inspection, modification, and redistribution under the project's license.
C.Every open source project is governed by a single company that owns all copyright and controls all decisions.
D.Open source software can never be sold or used in a commercial product.
E.Development often occurs in a public repository where contributors can submit bug reports, patches, and feature requests.
AnswersB, E

Open source software by definition makes source code available under a license that permits inspection, modification, and redistribution. This transparency allows the business to audit security, customize features, and avoid vendor lock-in. It is a fundamental characteristic of open source projects and aligns with the owner's goal of understanding how these projects operate.

Why this answer

Open source projects typically provide access to source code under a license permitting modification and redistribution, and they commonly use public repositories where community members can contribute bug reports and patches. These two characteristics reflect the transparency and collaboration central to open source. Free support and prohibitions on commercial use are not inherent to open source, and governance varies widely across projects.

Exam trap

The trap here is assuming that open source automatically includes free support or that commercial use is prohibited; neither is a defining characteristic of open source licensing.

220
MCQmedium

A developer runs `mkdir /srv/collab` on an ext4 filesystem, then runs `chmod 2775 /srv/collab` so that the directory is owned by root:devteam. Later, a member of the devteam group creates a file inside /srv/collab with their default umask of 022. Which group will own the newly created file?

A.No group, because the file is created without a group until chgrp is run explicitly.
B.The root group, because the parent directory is owned by root:devteam and ownership is copied.
C.The devteam group, because the setgid bit on the parent directory forces group inheritance.
D.The creating user's primary group, because file group ownership always mirrors the creator.
AnswerC

The setgid bit on a directory causes new files and subdirectories to inherit the directory's group (devteam) rather than the creator's primary group. This is precisely why the developer set mode 2775. The umask affects the permission bits, not the group ownership, so the file will be owned by the creating user but grouped under devteam.

Why this answer

The setgid bit on a directory makes new entries inherit the directory's group instead of the creator's primary group. Because the directory was set to 2775 with group devteam, any file created inside will belong to devteam while retaining the creator as user owner. The umask only strips permission bits and does not change group ownership.

Exam trap

The trap here is assuming that a file's group always comes from its creator, which ignores how the setgid bit changes group inheritance on directories.

221
MCQmedium

You need to create a compressed archive of the '/home/user/docs' directory named 'docs.tar.gz'. Which flag ensures gzip compression is applied?

A.tar -czf docs.tar.gz /home/user/docs
B.tar -jf docs.tar.gz /home/user/docs
C.tar -xzf docs.tar.gz /home/user/docs
D.tar -cf docs.tar.gz /home/user/docs
AnswerA

The `-z` flag invokes gzip compression during archive creation, satisfying the requirement for a `.tar.gz` file. Combined with `-c` to create and `-f` to specify the filename, `tar -czf` writes the compressed archive directly, avoiding a separate compression step.

Why this answer

The `-czf` flag combination in `tar` specifies: `-c` to create a new archive, `-z` to filter the archive through gzip for compression, and `-f` to specify the archive filename. This directly produces a gzip-compressed tarball named `docs.tar.gz` from the `/home/user/docs` directory. The `-z` flag is the key to invoking gzip compression, which is exactly what the question asks for.

Exam trap

The trap here is confusing the compression flags: candidates often mix up `-z` (gzip), `-j` (bzip2), and `-J` (xz), or mistakenly use `-x` (extract) instead of `-c` (create), leading to wrong answers like B or C.

How to eliminate wrong answers

Option B is wrong because `-j` invokes bzip2 compression, not gzip, which would produce a `.tar.bz2` file and is not the requested format. Option C is wrong because `-x` is used to extract an archive, not create one, so it would attempt to extract from `docs.tar.gz` rather than create it. Option D is wrong because it lacks any compression flag (`-z`, `-j`, etc.), so it would create an uncompressed tar archive named `docs.tar.gz` (misleadingly), not a gzip-compressed one.

222
Multi-Selectmedium

Which THREE commands are related to viewing or changing group memberships?

Select 3 answers
A.groups
B.chgrp
C.id
D.groupmod
E.usermod -aG
AnswersA, C, E

The `groups` command lists every group a user belongs to, directly satisfying the requirement to view group memberships. It reads the supplementary group IDs from the current process, printing names without needing elevated privileges. This makes it the definitive viewing command among the three, complementing `usermod` and `groupmod` for changes.

Why this answer

Option A, `groups`, is correct because it displays the groups a specified user (or the current user) belongs to, directly showing group memberships. Option C, `id`, is correct because it prints the user's UID, primary GID, and the list of supplementary groups the user is a member of, which is exactly membership information. Option E, `usermod -aG`, is correct because the `-aG` combination appends the user to one or more supplementary groups, thereby changing group memberships without removing existing ones.

Option B, `chgrp`, is not correct here because it changes the group ownership of files or directories, not a user's group membership. Option D, `groupmod`, is not correct because it modifies a group's attributes such as its name or GID, rather than viewing or changing which users belong to groups.

Exam trap

The trap is including groupmod or chgrp because they contain 'group' in the name — candidates must distinguish commands that manage group objects/files from those that manage a user's group membership.

223
MCQeasy

A junior administrator is logged into a Linux server and needs to view the contents of the file '/etc/hosts' without opening an editor. Which command should they run?

A.mkdir /etc/hosts
B.cat /etc/hosts
C.nano /etc/hosts
D.chmod /etc/hosts
AnswerB

The cat command concatenates and prints file contents to standard output, so running cat /etc/hosts displays the file directly in the terminal. It is the simplest way to view a short file without launching an editor. Since /etc/hosts is typically small, cat is appropriate and does not paginate or modify the file.

Why this answer

Viewing a file without editing it requires a reader such as cat, which streams the file to standard output. Editors like nano, permission tools like chmod, and directory creators like mkdir all serve different purposes and would either modify state or fail outright. For a short configuration file, cat is the direct and correct choice.

Exam trap

The trap here is assuming any command that accepts a filename as an argument will display that file's contents.

224
MCQhard

You want to set a default umask of 027 for all users. Which file should you edit to apply this globally?

A./etc/bashrc
B./etc/passwd
C.~/.bash_profile
D./etc/profile
AnswerD

Editing /etc/profile sets the umask for login shells across all users, satisfying the global default requirement. However, it only applies to Bourne-compatible login shells, so non-login shells or other shells may not inherit it; /etc/login.defs or /etc/bashrc often supplement this.

Why this answer

The /etc/profile file is a system-wide initialization script executed by login shells for all users. Placing a umask 027 command there sets the default umask globally, affecting every user who starts a login shell. This is the standard location for system-wide environment and shell settings on Linux distributions that use the Bourne-compatible shell family.

Exam trap

The trap here is confusing per-user shell configuration files (like ~/.bash_profile) with system-wide configuration files, or mistakenly thinking that /etc/passwd controls shell behavior, when it only stores account information.

How to eliminate wrong answers

Option A is wrong because /etc/bashrc is not a standard system-wide configuration file on most Linux distributions; the equivalent is usually /etc/bash.bashrc or /etc/bashrc on some systems, but it is shell-specific and not the primary global profile. Option B is wrong because /etc/passwd stores user account information (username, UID, GID, home directory, shell) and does not control shell initialization or umask settings. Option C is wrong because ~/.bash_profile is a per-user file, so editing it would only affect the user who owns that home directory, not all users globally.

225
MCQmedium

You need to create a new group named 'audit'. Which command should you execute?

A.newgroup audit
B.groupadd audit
C.useradd -g audit
D.addgroup audit
AnswerB

`groupadd audit` directly creates the group in `/etc/group`, satisfying the requirement for a new group named 'audit'. Unlike `usermod` or `gpasswd`, which modify existing groups, `groupadd` is the dedicated Linux utility for group creation, so it fulfils the stem's constraint without additional flags.

Why this answer

The `groupadd` command is the standard Linux utility for creating a new group, and `groupadd audit` will create a group named 'audit' in the system's group database (/etc/group). This is part of the shadow-utils package and is the canonical way to add groups on Linux distributions.

Exam trap

The trap here is confusing group creation with user creation or with Debian-specific wrappers — candidates who use Ubuntu daily may reflexively pick `addgroup`, but the LPI exam expects the portable, canonical `groupadd`.

How to eliminate wrong answers

Option A is wrong because `newgroup` is not a standard Linux command (it resembles the macOS/BSD `dseditgroup` or HP-UX `groupadd` variants, but does not exist on Linux). Option C is wrong because `useradd -g audit` creates a new user and assigns them to an existing group named 'audit'; it does not create the group itself. Option D is wrong because `addgroup` is a Debian/Ubuntu convenience script (part of the adduser package) that is not universally available and is not the canonical command tested on Linux Professional Institute exams.

Page 2

Page 3 of 5

Page 4

All pages