Courseiva

LPI Linux Essentials (010-160, v1.6) (010-160) (010-160) — Questions 226–300

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

Page 3

Page 4 of 5

Page 5
226
MCQeasy

Which permission bit must be set on a directory to allow a user to enter the directory and access files within it?

A.Write (w)
B.Execute (x)
C.Sticky bit
D.Read (r)
AnswerB

Execute (x) permission on a directory grants traverse rights, letting a user pass through it and reach files inside. Without it, path resolution fails even if the files themselves are readable, so x satisfies the stem's requirement to enter the directory and access its contents.

Why this answer

The execute (x) bit on a directory grants the right to traverse it — that is, to access files and subdirectories by name within it. Without x, even if you have read permission, you cannot cd into the directory or open files whose paths pass through it.

Exam trap

The trap is assuming read permission is sufficient to access files in a directory — candidates pick 'Read (r)' because it sounds like the permission needed to 'see' files, but traversal specifically requires execute (x).

How to eliminate wrong answers

Option A is wrong because write (w) on a directory allows creating, deleting, and renaming entries within it, but does not by itself permit traversal or access to existing files. Option C is wrong because the sticky bit (t) on a directory restricts deletion of files to their owners (used on /tmp); it does not grant traversal. Option D is wrong because read (r) on a directory only allows listing the directory's entries (e.g., via ls), not entering it or accessing files inside.

227
MCQeasy

A technician has just unpacked a new server and needs to confirm which physical architecture the CPU reports so they can request the matching RPM package. Which command will display the machine's hardware architecture, such as x86_64?

A.hostnamectl status
B.lsb_release -a
C.uname -m
D.uname -r
AnswerC

The -m flag of uname prints the machine hardware name as reported by the kernel, for example x86_64 or aarch64. This is exactly the architecture string a package manager uses to select a matching build, so it directly answers the technician's need without extra parsing or guesswork.

Why this answer

The uname utility reports kernel and system information, and its -m option specifically returns the machine hardware architecture, such as x86_64 or aarch64. That string is what package tools use to select an architecture-appropriate build, so it is the direct and reliable answer when a technician must match a package to the server's CPU.

Exam trap

The trap here is confusing the kernel release reported by uname -r with the hardware architecture reported by uname -m.

228
Multi-Selecteasy

Which TWO of the following are true about the 'others' category of file permissions?

Select 2 answers
A.Only root can modify this category.
B.Is the last set of characters in the 'ls -l' output.
C.Automatically inherits group permissions.
D.Can override owner permissions.
E.Represents all users not the owner and not in the group.
AnswersB, E

In ls -l output, permissions appear as three character triplets: owner, group, then others. The final triplet governs users who are neither the file's owner nor members of its group, so it is indeed the last set of characters displayed.

Why this answer

Option B is correct because in the ten-character permission string produced by 'ls -l' (e.g., -rwxr-xr-x), the final three characters represent the permissions for the 'others' category, following the owner and group triplets. Option E is correct because 'others' is defined as every user account that is neither the file's owner nor a member of the file's owning group, so those users are governed by this third permission set. Option A is wrong because any user who falls into the 'others' category is affected by these bits, and the owner or root can change them via chmod; it is not restricted to root.

Option C is wrong because 'others' permissions are set independently and do not inherit from group permissions. Option D is wrong because owner permissions take precedence in the kernel's permission-checking order (owner, then group, then others), so 'others' can never override the owner's bits.

Exam trap

The trap is believing permission categories inherit or override each other — candidates may pick 'automatically inherits group permissions' or 'can override owner permissions,' but the three triads are independent and evaluated in strict owner→group→others order.

229
Multi-Selecthard

An administrator is reviewing how pathnames are resolved on a Linux system and wants to identify statements that correctly describe absolute and relative paths. (Choose two.)

Select 2 answers
A.Any path containing a dot component is treated as an absolute path by the shell.
B.The path `../docs/report.txt` is relative and refers to a file in a sibling directory of the current one.
C.A relative path is resolved against the root directory when the shell's current directory is unset.
D.An absolute path always begins with a forward slash and is interpreted from the root directory.
E.Two different relative paths can never resolve to the same file.
AnswersB, D

Because the path does not start with a slash, it is relative to the current working directory. The leading `..` moves up to the parent, and `docs` then descends into a sibling of the current directory, locating `report.txt` there. This is a common idiom for referencing nearby directories without spelling out a full absolute path, and the description is accurate.

Why this answer

Absolute paths anchor at the root because of the leading slash, while relative paths are interpreted against the process working directory. The `..` component lets a relative path climb to a parent and then descend elsewhere, which is how a sibling directory can be addressed without a full path. Two statements correctly describe these behaviors, and the remaining ones misstate resolution rules.

Exam trap

The trap here is assuming dots or textual form determine whether a path is absolute, when only the leading slash does.

230
MCQhard

An administrator wants to create a hard link named 'report_link' to an existing file '/data/report.txt' on the same filesystem. Which command creates this hard link?

A.cp -l /data/report.txt report_link
B.link -s /data/report.txt report_link
C.ln /data/report.txt report_link
D.ln -s /data/report.txt report_link
AnswerC

The ln command without options creates a hard link. Both /data/report.txt and report_link then reference the same inode, so they are indistinguishable entries for the same data. The link count of the inode increases by one. This is the correct syntax and produces a true hard link as requested.

Why this answer

A hard link is created with ln followed by the existing file and the new link name, producing two directory entries that share one inode. The -s flag would create a symbolic link instead, and the link utility lacks that flag. While cp -l can also hard-link, ln is the direct, standard command for this operation.

Exam trap

The trap here is mixing up the -s flag, which switches to symbolic links, with the default behavior of creating hard links.

231
MCQmedium

A user wants to find all files under /home that are larger than 100 MB and were modified in the last 7 days. Which command accomplishes this?

A.find /home -type f -size 100M -mtime 7
B.find /home -type f -size +100M -mtime -7
C.find /home -type f -size +100M -mtime +7
D.find /home -name '*' -size +100M -mtime +7
AnswerB

This find command searches /home, restricts to regular files with -type f, matches files larger than 100 MB with -size +100M, and files modified within the last 7 days with -mtime -7. All conditions are ANDed by default, so it returns exactly the desired files.

Why this answer

The correct command uses -type f for regular files, -size +100M for files larger than 100 MB, and -mtime -7 for files modified within the last 7 days. The other options either match exact sizes, exact ages, or use +7 which selects older files, failing the scenario's criteria.

Exam trap

The trap here is misreading the plus and minus signs in find: +100M means larger, -7 means within the last 7 days, and reversing them changes the result.

232
Multi-Selecthard

Which THREE of the following are special permission bits in Linux?

Select 3 answers
A.Immutable bit
B.Sticky bit
C.Append-only bit
D.Setgid
E.Setuid
AnswersB, D, E

The sticky bit is a special permission bit, set on directories to restrict deletion so only a file's owner, the directory owner, or root may remove or rename entries within it. This satisfies the question's requirement for special permission bits, alongside setuid and setgid, distinguishing it from standard read, write, and execute permissions.

Why this answer

The sticky bit (B) is a special permission bit, historically used on directories so that only a file's owner (or root) can delete or rename files within it, and it appears as a 't' in the other-execute position of ls -l output. Setgid (D) is a special permission bit that, when set on an executable, runs it with the file's group identity, and when set on a directory causes new files to inherit the directory's group; it is shown as 's' in the group-execute position. Setuid (E) is a special permission bit that makes an executable run with the file owner's effective UID, displayed as 's' in the user-execute position.

By contrast, the immutable bit (A) and append-only bit (C) are file attributes managed by chattr and viewed with lsattr (e.g., chattr +i and chattr +a), not permission bits set via chmod, so they are not among the three special permission bits.

Exam trap

The trap is conflating filesystem attributes (immutable, append-only, managed by chattr/lsattr) with permission bits (setuid, setgid, sticky, managed by chmod) — the exam deliberately mixes them to test whether you know the difference between inode attributes and mode bits.

233
MCQmedium

You need to search for a specific command description within the manual pages using a keyword. Which command should you use?

A.man -s
B.man -f
C.man -k
D.help
AnswerC

`man -k` searches the manual page's short descriptions (the whatis database) for a keyword, returning every matching entry. This directly satisfies the stem's requirement to locate a command by keyword rather than browsing a single page, which plain `man` cannot do.

Why this answer

The 'man -k' option (equivalent to 'apropos') searches the manual page short descriptions for a keyword and returns all matching entries, which is exactly what you need when you know a concept but not the command name. It queries the whatis database built by mandb/makewhatis. This is the standard way to locate commands by keyword rather than by exact name.

Exam trap

The trap here is confusing 'man -k' (keyword search across descriptions, like apropos) with 'man -f' (exact-name lookup, like whatis) — candidates often pick -f thinking it means 'find'.

How to eliminate wrong answers

Option A is wrong because 'man -s' selects a specific manual section (e.g., 'man -s 1 ls' for section 1), not a keyword search. Option B is wrong because 'man -f' (equivalent to 'whatis') returns a one-line description for an exact command name, not a keyword-based search across descriptions. Option D is wrong because 'help' is a shell builtin that displays information about shell builtins, not a tool for searching manual page descriptions.

234
MCQhard

An administrator is comparing package management systems. Which tool is primarily used on RHEL-based distributions for resolving dependencies and downloading packages?

A.DNF
B.Pacman
C.Portage
D.APT
AnswerA

DNF resolves dependencies and downloads packages on RHEL-based distributions, satisfying the stem's platform constraint. As the successor to YUM, it uses libsolv for dependency solving and reads repository metadata to fetch RPM packages, making it the native package manager for RHEL, Fedora and CentOS Stream.

Why this answer

DNF (Dandified YUM) is the default high-level package manager on modern RHEL-based distributions (RHEL 8+, Fedora, CentOS Stream, Rocky, AlmaLinux). It resolves dependencies using the libsolv library and downloads packages from configured repositories, replacing the older YUM tool while maintaining CLI compatibility.

Exam trap

The trap is assuming all Linux distributions share one package manager; candidates must map DNF→RHEL/Fedora, APT→Debian/Ubuntu, Pacman→Arch, and Portage→Gentoo rather than guessing by familiarity.

How to eliminate wrong answers

Option B (Pacman) is wrong because Pacman is the package manager for Arch Linux and its derivatives, using .pkg.tar.zst packages and its own dependency resolver. Option C (Portage) is wrong because Portage is the package management system for Gentoo, built around source-based ebuilds and the emerge command. Option D (APT) is wrong because APT (Advanced Package Tool) is used on Debian-based distributions such as Ubuntu and Debian, working with .deb packages and dpkg underneath.

235
MCQmedium

What is the result of the command 'ls -la | grep "^d"'?

A.It shows only hidden files.
B.It lists files that contain the letter 'd'.
C.It deletes all directories.
D.It lists only directories in the current directory.
AnswerD

grep "^d" matches lines beginning with d, the first character in ls -la output denoting a directory. Piping the long listing through this filter therefore returns only directories, satisfying the scenario's requirement to list directories alone.

Why this answer

The command 'ls -la | grep "^d"' lists all files and directories in long format, including hidden ones, and then filters the output to show only lines starting with 'd', which indicates a directory. Thus, it lists only directories in the current directory.

Exam trap

Linux Essentials often tests the interpretation of command pipelines; candidates may think grep searches for the letter 'd' anywhere, but the '^' anchors it to the start of the line.

How to eliminate wrong answers

Option A is wrong because hidden files are included but not exclusively; the command shows directories, hidden or not. Option B is wrong because grep searches for lines starting with 'd', not files containing the letter 'd'. Option C is wrong because the command does not delete anything; it only lists.

236
MCQhard

A hospital's IT department wants to adopt a Linux-based electronic records system. Legal counsel insists that the hospital be able to audit and modify the source code to meet patient-data regulations, and that any redistributed improvements remain under the same freedoms. Which licensing approach best satisfies counsel's requirements?

A.A copyleft license such as the GNU GPL, because derivative works must be distributed under the same license terms.
B.A proprietary license with a source-code escrow agreement, because escrow guarantees permanent access to the code.
C.A public domain dedication, because it removes all restrictions and lets the hospital do anything it wants.
D.A permissive license such as MIT, because it allows modification without any redistribution conditions.
AnswerA

The GNU GPL grants the rights to audit, modify, and redistribute source code while requiring that derivative works be licensed under the same terms. That ensures any redistributed improvements remain open and auditable, precisely matching counsel's demand that the same freedoms be preserved downstream.

Why this answer

Counsel wants both the ability to audit and modify source code and the guarantee that redistributed improvements stay open. A copyleft license such as the GNU GPL provides exactly those rights and obligations. Permissive and public domain licenses allow proprietary relicensing downstream, and escrow grants only conditional access without modification rights.

Exam trap

The trap here is equating permissiveness with stronger guarantees, when in fact permissive licenses allow downstream code to become closed.

237
MCQhard

A junior administrator is asked to verify whether a newly installed application is truly open source. The application's documentation states that the source code is available but forbids modification and redistribution. Which statement best evaluates this claim?

A.It does not qualify as open source because modification and redistribution are prohibited.
B.It qualifies as open source because users can read and audit the code.
C.It qualifies as open source because the source code is publicly available.
D.It qualifies as open source if the vendor provides the source code on request.
AnswerA

The Open Source Initiative definition requires that the license permit modification and redistribution, including derived works. Since this application explicitly forbids both, it fails the definition regardless of source availability. The administrator should classify it as source-available or proprietary, not open source.

Why this answer

Open source requires more than visible source code; the license must permit modification and redistribution. Because this application forbids both, it fails the Open Source Initiative definition and should be treated as source-available or proprietary despite its published code.

Exam trap

The trap here is equating source availability with open source and ignoring the required freedoms to modify and redistribute.

238
Multi-Selectmedium

A security audit requires reviewing which local accounts exist on a Linux server, which of them have usable login shells, and which groups each account belongs to. Which TWO commands or files provide authoritative local account and group membership information? (Choose two.)

Select 2 answers
A./etc/shadow
B./etc/passwd
C./etc/skel
D./etc/group
E./etc/nsswitch.conf
AnswersB, D

This file stores one line per local account with fields for username, UID, primary GID, home directory, and login shell. Auditors can read it to enumerate accounts and identify those with interactive shells versus system accounts using /usr/sbin/nologin or /bin/false. It is the canonical source for local user account information.

Why this answer

Local account records live in /etc/passwd, and local group definitions with supplementary members live in /etc/group. Reading them together reveals which accounts exist, what login shells they have, and which groups each belongs to. The shadow file covers passwords, skel provides templates, and nsswitch merely directs lookup order, so those three do not supply the required listings.

Exam trap

The trap here is reaching for /etc/shadow as the account database, when it actually stores password aging data and is unreadable to non-root auditors.

239
MCQmedium

A user wants to find all files under /var/log that have been modified within the last 24 hours and are larger than 1 MB, then save the list to /tmp/recent_large.txt. Which command accomplishes this?

A.ls -lR /var/log | awk '$6 > 1 && $7 > 1' > /tmp/recent_large.txt
B.locate -mtime -1 -size +1M /var/log > /tmp/recent_large.txt
C.find /var/log -type f -mtime -1 -size +1M > /tmp/recent_large.txt
D.grep -R -l --include='*' -mtime -1 -size +1M /var/log > /tmp/recent_large.txt
AnswerC

This command uses find with -mtime -1 to match files modified less than 24 hours ago, -size +1M for files larger than 1 MB, and redirects the output to the specified file. It directly meets all criteria: search path, file type, time, size, and output redirection.

Why this answer

The find command is designed to search for files based on metadata such as modification time and size. Using -mtime -1 selects files modified within the last 24 hours, and -size +1M selects files larger than 1 MB. Redirection saves the output.

The other commands lack these filtering capabilities or misinterpret the options.

Exam trap

The trap here is confusing grep's recursive search with find's metadata filtering, assuming grep can filter by time or size.

240
MCQhard

Your company is considering moving from proprietary software to open source solutions. Which aspect of the GPL license is most restrictive regarding the distribution of modified code?

A.You must contribute all modifications back to the original project maintainer.
B.You must release the source code of any derivative works if you distribute the binaries.
C.You are not allowed to modify the source code for internal business use.
D.You are forbidden from selling any software that uses GPL code.
AnswerB

The GPL's copyleft clause requires that anyone distributing binaries of derivative works must also make the corresponding source code available under the same licence. This satisfies the stem's constraint by identifying the most restrictive distribution obligation.

Why this answer

The GPL's core copyleft obligation is that if you distribute binaries of a derivative work, you must also make the complete corresponding source code available under the same GPL terms. This 'viral' requirement is what makes the GPL more restrictive than permissive licenses like MIT or BSD when distributing modified code.

Exam trap

The trap is conflating 'must contribute back to the project' with 'must provide source to recipients' — the GPL requires the latter, not the former, and candidates often pick the more intuitive-sounding 'contribute back' answer.

How to eliminate wrong answers

Option A is wrong because the GPL does not require you to send modifications back to the original maintainer; it only requires that recipients of your distributed binaries receive the source. Option C is wrong because the GPL explicitly permits unlimited modification for internal use — the copyleft obligations only trigger upon distribution. Option D is wrong because the GPL does not prohibit selling software; it only requires that buyers receive the same freedoms, including source code access.

241
MCQmedium

While troubleshooting a script, you run `grep -n 'error' /var/log/app.log` and see output lines prefixed with numbers. A colleague asks what those numbers represent. What do they indicate?

A.The total count of matching lines found in the file.
B.The line number in the file where each matching line occurs.
C.The process ID of the application that wrote each log entry.
D.The byte offset from the start of the file to each match.
AnswerB

The -n option to grep prefixes each matching line with its 1-based line number within the input file. This is useful for locating matches in large files or when you need to reference a specific line later. In this scenario, the numbers identify where in /var/log/app.log each 'error' match appears.

Why this answer

The -n flag tells grep to prefix each matching line with its line number in the source file. This helps pinpoint where matches occur without opening an editor. Other grep flags like -c count matches and -b show byte offsets, but only -n provides the line position shown in the scenario.

Exam trap

The trap here is confusing grep's line-number prefix with a match count or byte offset, which are produced by different flags.

242
Multi-Selectmedium

A nonprofit is drafting a policy that explains how its staff may legally use and redistribute open source software. The draft must correctly reflect the freedoms that free and open source licenses grant to recipients. Which two statements accurately describe those freedoms? (Choose two.)

Select 2 answers
A.Recipients may study the source code and modify it to suit their needs
B.Recipients may run the software for any purpose, including commercial use
C.Recipients must always pay a licensing fee to the original author before deploying the software
D.Recipients may remove the original author's copyright notice before publishing modified versions
E.Recipients may redistribute the software only within the same organization that originally obtained it
AnswersA, B

Access to source code and the right to modify it are fundamental freedoms that distinguish open source from proprietary software. The Free Software Definition lists studying and changing the program as essential, and the Open Source Definition requires derived works to be permitted. A policy that documents this freedom accurately tells staff they may adapt tools internally without seeking permission from the original author.

Why this answer

Free and open source licenses grant recipients the freedom to use software for any purpose, including commercial activity, and to study and modify its source code. These two permissions form the backbone of both the Free Software Definition and the Open Source Definition. Mandatory licensing fees, organization-only redistribution, and removal of copyright notices are not granted rights and would misrepresent the legal position of the nonprofit's staff.

Exam trap

The trap here is conflating the freedom to modify and use software with a supposed freedom to strip attribution or restrict redistribution, which no recognized open source license permits.

243
MCQhard

A user complains they cannot read a file. The file has permissions 640 and is owned by root, but the user is in the group that owns the file. Why can't they read it?

A.The umask is set to 077.
B.The user lacks execute permission on a parent directory.
C.The user is not the owner.
D.The file is locked by root.
AnswerB

Reading a file requires execute (search) permission on every parent directory in its path. Without execute permission on a parent directory, the user cannot traverse into it to reach the file, so read access on the file itself is irrelevant.

Why this answer

On Linux, reading a file requires execute (x) permission on every directory in the path leading to the file. Even though the file's group permissions include read (the '4' in 640), the user cannot traverse into the directory containing the file without execute permission on that parent directory. This is the classic 'permission denied' scenario where file permissions look correct but directory traversal is blocked.

Exam trap

The trap here is focusing only on the file's own permission bits (640) and forgetting that directory execute permission is a prerequisite for any file access — a concept the LPI 010-160 exam frequently tests.

How to eliminate wrong answers

Option A is wrong because umask affects the default permissions of newly created files and directories; it does not retroactively change existing file permissions and is irrelevant to why an already-created 640 file cannot be read. Option C is wrong because the user is in the group that owns the file, so the group permission bits (the '4' in 640) apply to them — ownership is not the issue. Option D is wrong because Linux does not have a 'file lock by root' concept that prevents reads; root can read any file, and file locking (flock/fcntl) is advisory and does not produce permission-denied errors.

244
Multi-Selecteasy

Which THREE of these are valid types of permissions in Linux file systems?

Select 3 answers
A.Read
B.Execute
C.Write
D.Delete
E.Append
AnswersA, B, C

Read permission lets a user open and view a file's contents, and list a directory's entries. It satisfies the stem's requirement for a valid Linux file-system permission type, forming one of the three standard permission bits (read, write, execute) applied to owner, group and others.

Why this answer

In Linux file systems, the standard permission model defines exactly three basic permission types: read (r), write (w), and execute (x), so options A (Read), B (Execute), and C (Write) are all correct. Read allows viewing file contents or listing a directory, write allows modifying file contents or creating/deleting entries within a directory, and execute allows running a file as a program or traversing a directory. These three permissions are represented in the rwx notation and in octal values (4, 2, 1) used by chmod.

Option D (Delete) is not a distinct permission type; deletion is governed by write and execute permissions on the containing directory. Option E (Append) is also not a separate permission type in the standard Linux model; append-only behavior is enforced through file attributes such as chattr +a, not through the rwx permission bits.

Exam trap

The trap is that 'delete' and 'append' feel like natural file operations, so candidates assume they must be permission types — but Linux only defines read, write, and execute bits.

245
MCQhard

What is the result of running 'chmod 000 secret.txt'?

A.The file becomes read-only for root.
B.No user can access it (except root).
C.Only the owner can access it.
D.The file is deleted.
AnswerB

Setting all permission bits to zero removes read, write and execute access for owner, group and others, satisfying the stem's requirement that the file becomes inaccessible. Root bypasses these discretionary checks via CAP_DAC_OVERRIDE, so the parenthetical exception holds. Ordinary users, including the owner, are denied until permissions are restored.

Why this answer

chmod 000 removes all permission bits (read, write, execute) for owner, group, and others, so no regular user can read, write, or execute the file. Root bypasses discretionary permission checks on most filesystems, so root can still access it. This is why the correct answer is that no user can access it except root.

Exam trap

The trap here is assuming the owner always retains access to their own file, but chmod 000 removes owner permissions too, and root's special bypass is the only exception.

How to eliminate wrong answers

Option A is wrong because 000 does not make the file read-only for root; root retains full access regardless of permission bits, and read-only would be a different mode such as 444. Option C is wrong because 000 removes owner permissions too, so the owner cannot access it either (unless they are root). Option D is wrong because chmod only changes permission bits; it never deletes a file, and deletion requires rm or unlink.

246
MCQmedium

An open source developer wants to choose a license that allows their code to be included in proprietary software without requiring the proprietary software to open its source. Which license should they choose?

A.AGPL
B.GPLv3
C.MIT
D.Creative Commons Attribution-ShareAlike
AnswerC

MIT permits relicensing within proprietary products because it imposes no copyleft obligation, requiring only attribution and retention of the licence notice. This satisfies the stem's constraint that derivative proprietary software need not disclose its source, unlike GPL-family licences whose reciprocal terms would force source release.

Why this answer

The MIT License is a permissive license that allows code to be used, modified, and distributed in proprietary software, requiring only attribution and inclusion of the license text. It imposes no copyleft obligation, so derivative works can remain closed-source.

Exam trap

The trap is assuming all 'open source' licenses are equivalent — candidates who know GPL is 'open' may pick it without realizing copyleft forces source disclosure, which contradicts the proprietary-inclusion requirement.

How to eliminate wrong answers

Option A is wrong because the AGPL is a strong copyleft license that extends GPL obligations to network use — if the software is offered as a service, the source must be provided, which is incompatible with keeping proprietary software closed. Option B is wrong because GPLv3 is a strong copyleft license requiring any distributed derivative to be licensed under GPLv3, forcing source disclosure. Option D is wrong because Creative Commons Attribution-ShareAlike is a copyleft license designed for creative works, not software, and its ShareAlike clause requires derivatives to use the same license — unsuitable for proprietary inclusion.

247
MCQhard

A Linux system administrator notices that the /var/log directory is filling up quickly. They want to find the largest files within that directory tree to identify what is consuming space. Which command will accomplish this?

A.du -ah /var/log | sort -rh | head -n 10
B.df -h /var/log
C.ls -lS /var/log
D.find /var/log -type f -size +100M
AnswerA

This pipeline uses du -ah to list all files and directories with human-readable sizes, sort -rh to sort by size in reverse order (largest first), and head to show the top 10. It effectively identifies the largest files and directories in /var/log, directly addressing the administrator's need.

Why this answer

The combination of du -ah, sort -rh, and head -n 10 provides a sorted list of the largest files and directories under /var/log. This allows the administrator to quickly identify space hogs. Other commands either filter by size, limit to one directory level, or show filesystem-wide usage, which are not as effective for this specific task.

Exam trap

The trap here is assuming that df or ls alone can recursively find large files; df shows filesystem totals, and ls without -R only lists one directory level.

248
MCQmedium

A user needs to find every regular file under /var/log whose name ends in `.log` and whose size is larger than 10 megabytes, then delete them. Which command accomplishes this safely?

A.find /var/log -type f -name '*.log' -size +10M -delete
B.ls -l /var/log/*.log | awk '$5>10485760 {print $9}' | rm
C.find /var/log -name '*.log' -size +10M -exec rm -rf {} \;
D.grep -rl '*.log' /var/log | xargs rm -f
AnswerA

The find command combines the predicates -type f (regular files), -name '*.log' (name pattern), -size +10M (greater than 10 megabytes), and -delete to remove matches. This is safe because -delete only acts on files that satisfy all preceding tests, and it avoids invoking a separate process for each file. It also respects the directory traversal order.

Why this answer

The find command with -type f, -name '*.log', -size +10M, and -delete precisely targets regular files larger than 10 MB with the .log suffix and removes them. It avoids content-based matching, does not rely on parsing ls output, and does not risk recursive directory deletion, making it the safe and correct choice.

Exam trap

The trap here is confusing filename matching with content searching, and forgetting that rm does not read from standard input.

249
MCQeasy

A user wants to count the number of lines in a file named 'access.log'. Which command should be used?

A.head -n 999999 access.log | wc -l
B.wc -l access.log
C.cat -n access.log
D.grep -c '' access.log
AnswerB

The wc command with the -l option counts the number of newline characters in the file, which corresponds to the number of lines. This is the standard and simplest way to count lines in a file, directly providing the required information without additional processing.

Why this answer

The wc -l command is specifically designed to count lines in a file by counting newline characters. It is efficient, simple, and the de facto standard for this task. The other commands either display the file, use a less direct method, or introduce unnecessary complexity and potential inaccuracies.

Exam trap

The trap here is overcomplicating a simple task by using grep or head pipelines instead of the purpose-built wc command.

250
MCQmedium

A consultant is preparing a presentation about the Linux ecosystem. She needs to explain the relationship between the kernel and a complete Linux distribution. Which statement best describes this relationship?

A.The kernel and a distribution are the same thing; the terms are interchangeable in modern Linux usage.
B.A distribution is a graphical desktop environment, and the kernel is the command-line shell used to launch it.
C.The kernel is the core that manages hardware and system resources, while a distribution bundles the kernel with utilities, libraries, and package management.
D.A distribution is maintained solely by the kernel developers, and the kernel is compiled separately by each end user.
AnswerC

This correctly separates the kernel, which handles process scheduling, memory, devices, and system calls, from a distribution, which adds user-space tools, libraries, an init system, and package management. A distribution is what users actually install; the kernel alone is not usable for typical tasks. This matches how LPI describes the Linux ecosystem.

Why this answer

The kernel is the privileged core managing hardware and resources through system calls, while a distribution packages that kernel with user-space utilities, libraries, an init system, and package management. This division explains why different distributions can share kernel versions yet differ greatly in tooling and support. The other statements misidentify components or conflate the two concepts.

Exam trap

The trap here is assuming that because every Linux system has a kernel, the kernel by itself constitutes a usable distribution.

251
MCQeasy

A user wants to view the contents of a text file named 'notes.txt' one page at a time, and also be able to scroll backward and forward within the file. Which command is best suited for this task?

A.less notes.txt
B.tail notes.txt
C.head notes.txt
D.cat notes.txt
AnswerA

less is a pager that displays a file one screenful at a time and allows both forward and backward scrolling using arrow keys, Page Up/Down, and search. It is ideal for viewing large text files interactively. This matches the user's need to scroll in both directions.

Why this answer

less is a terminal pager that allows interactive viewing of text files, supporting scrolling in both directions, searching, and jumping to specific lines. Unlike cat, which dumps the whole file, or head and tail, which show only a portion, less gives the user full navigational control, making it the best choice for reading a file page by page.

Exam trap

The trap here is confusing less with more, but less provides backward scrolling while more typically only scrolls forward.

252
MCQhard

A user reports that a script stored on a mounted USB drive will not execute when invoked by name, even though it runs when called explicitly through the shell with bash script.sh. The file has execute permission set for the user. Which is the most likely cause?

A.The filesystem is mounted with the noexec option, preventing execution of binaries from that mount.
B.The user's PATH does not include the mount point of the USB drive.
C.The script is owned by root and the user is not root.
D.The script lacks a shebang line, so the kernel cannot determine an interpreter.
AnswerA

A mount option of noexec blocks direct execution of files on that filesystem while still permitting them to be read and interpreted, which explains why bash script.sh works but running the script by name fails. This is a common hardening setting for removable media and temporary mounts.

Why this answer

The noexec mount option allows files to be read but forbids executing them directly from that filesystem. That precisely matches a script failing when invoked by name on a USB drive while still running when handed to an interpreter explicitly, since interpretation only requires read access.

Exam trap

The trap here is focusing on file permissions or PATH when a mount-level restriction is what blocks direct execution.

253
MCQmedium

A system administrator is checking for hardware errors in the logs. Where are general system messages usually stored?

A./etc/log/
B./var/log/syslog
C./proc/logs
D./tmp/logs
AnswerB

On most Linux distributions, general system and service messages are written to /var/log/syslog by the syslog daemon, making it the standard location for reviewing hardware and system errors. Kernel-specific messages may also appear in dmesg or kern.log.

Why this answer

General system messages on most Linux distributions are written to /var/log/syslog (Debian/Ubuntu) or /var/log/messages (RHEL/CentOS). The /var/log directory is the standard location for system and application logs, and syslog is the traditional catch-all for kernel, daemon, and service messages.

Exam trap

The trap is choosing /etc/log/ or /proc/logs because they 'sound' like log locations — but /etc is for configuration and /proc is a virtual kernel interface, so only /var/log/syslog is a real log file.

How to eliminate wrong answers

Option A is wrong because /etc/log/ does not exist as a standard directory — /etc holds configuration files, not logs. Option C is wrong because /proc is a virtual filesystem exposing kernel and process state (e.g., /proc/cpuinfo, /proc/meminfo), not a log storage location. Option D is wrong because /tmp is for temporary files that may be cleared on reboot and is not used for persistent system logs.

254
MCQhard

A user runs `grep -E '^[A-Z][a-z]+ [0-9]{3}$' file.txt` and gets no output, even though file.txt contains lines like `Alpha 123` and `Beta 456`. What is the most likely explanation?

A.The pattern requires exactly one uppercase letter followed by one or more lowercase letters, then a space, then exactly three digits, and the end of line; the lines may contain trailing spaces or other characters.
B.The pattern requires the first letter to be uppercase and the rest lowercase, but the lines start with uppercase and have digits, which is not allowed by [a-z]+.
C.The pattern uses {3} which is not supported by grep without the -P option.
D.The -E option is invalid for grep and causes it to ignore the pattern.
AnswerA

The regular expression ^[A-Z][a-z]+ [0-9]{3}$ anchors the match to the entire line. The $ asserts the end of line immediately after the three digits. If the lines have trailing spaces, carriage returns, or any extra characters, the pattern fails. This is the most likely cause of no output when the visible content appears to match.

Why this answer

The regex anchors to the full line with ^ and $. If the lines contain trailing whitespace, carriage returns, or other invisible characters, the pattern will not match despite the visible text appearing correct. This is the most common cause of such a failure when the regex itself is syntactically valid.

Exam trap

The trap here is assuming the regex is wrong when the actual issue is invisible characters like trailing spaces or CRLF line endings that break the $ anchor.

255
MCQhard

A hospital IT team is evaluating open source software for a patient scheduling system. Legal counsel asks how the team can verify that the project's license permits commercial use and modification while requiring attribution. Which action best addresses this concern?

A.Ask the vendor's sales representative to confirm the permitted uses in writing
B.Confirm that the software can be downloaded at no cost from the vendor
C.Review the project's declared license text against the Open Source Initiative's approved license list
D.Check whether the project's website describes itself as 'free' or 'open'
AnswerC

The authoritative way to confirm that a license permits commercial use and modification is to read the actual license text and compare it with the Open Source Initiative's approved licenses, which by definition allow commercial use and derived works. Attribution requirements appear explicitly in licenses such as Apache 2.0 or BSD. This gives legal counsel verifiable evidence rather than assumptions based on marketing claims.

Why this answer

Legal verification requires the actual license terms, not marketing claims, price, or verbal assurances. Comparing the project's license text to the Open Source Initiative's approved list confirms that commercial use and modification are permitted, and licenses such as Apache 2.0 or BSD explicitly state attribution obligations. This approach produces the defensible evidence legal counsel requires.

Exam trap

The trap here is treating a project's self-description or a sales representative's assurance as proof of licensing rights, when only the license text governs usage.

256
MCQmedium

What does the command 'history' do?

A.It shows the date and time of file creation.
B.It displays the system log history.
C.It deletes all previous command history.
D.It prints the command history list.
AnswerD

The `history` builtin prints the numbered list of previously executed commands held in the shell's in-memory history list, satisfying the stem's request directly. It neither re-runs commands nor edits the list; those require separate mechanisms such as `!!` expansion or `history -c`.

Why this answer

The 'history' command in Bash and other POSIX shells prints the numbered list of previously executed commands stored in the shell's history buffer (typically ~/.bash_history). It is a shell builtin, not an external binary, and it reads from the in-memory history list maintained per session. This is the standard way to review and recall prior commands for reuse or auditing.

Exam trap

The trap here is confusing 'history' (shell command history) with system logging tools like journalctl or /var/log files — candidates who have not used the shell interactively may pick the 'system log' option.

How to eliminate wrong answers

Option A is wrong because file creation timestamps are shown by 'ls -l', 'stat', or 'ls --time=creation' — 'history' has nothing to do with filesystem metadata. Option B is wrong because system logs are viewed with 'journalctl', 'dmesg', or files under /var/log — 'history' only shows the current user's shell command history, not system events. Option C is wrong because 'history -c' clears the history list; plain 'history' only displays it, and it never deletes anything.

257
MCQeasy

Which of the following commands is used to create an empty file or update the timestamp of an existing file?

A.cp
B.touch
C.mkdir
D.mv
AnswerB

The `touch` command creates a zero-byte file when the target does not exist, and updates the access and modification timestamps to the current time when it does. This dual behaviour directly satisfies the stem's requirement to either create an empty file or refresh an existing file's timestamp.

Why this answer

The `touch` command is specifically designed to create an empty file if it does not exist, or update the access and modification timestamps of an existing file to the current time. It does this by making a `utime()` system call, which sets the file's timestamps without altering its content. This is the standard Linux/Unix utility for timestamp manipulation and empty file creation.

Exam trap

The trap here is confusing file creation with directory creation or file copying; candidates might think `cp` or `mkdir` can create empty files, but only `touch` is purpose-built for that and timestamp updates.

How to eliminate wrong answers

Option A is wrong because `cp` copies files or directories, and while it can create a new file as a copy, it does not create an empty file by default nor does it update timestamps of an existing file without copying content. Option C is wrong because `mkdir` creates directories, not files, and does not affect timestamps. Option D is wrong because `mv` moves or renames files, which changes the file's location or name but does not create an empty file or update timestamps in the sense described.

258
MCQhard

Which of the following describes the 'upstream' concept in Linux software development?

A.The kernel configuration files located in /etc/.
B.The servers where users download their Linux distributions.
C.The original developers and project repositories for a piece of software.
D.The physical location of the data centers hosting the software.
AnswerC

Upstream denotes the original developers and their canonical repositories, from which distributions and downstream packagers obtain source code. This satisfies the stem's requirement by identifying the authoritative origin of a project, distinguishing it from the modified, repackaged versions that Linux distributions subsequently maintain and ship to users.

Why this answer

In Linux and open-source development, 'upstream' refers to the original project maintainers and their canonical source repositories — the place where code is authored, reviewed, and released. Downstream consumers (distributions, vendors, forks) pull from upstream and may carry patches, but the upstream project is the source of truth.

Exam trap

The trap is that 'upstream' sounds like it could refer to servers, mirrors, or infrastructure — candidates who haven't worked with open-source contribution workflows pick the download-server option instead of the correct code-provenance meaning.

How to eliminate wrong answers

Option A is wrong because /etc/ holds system configuration files, not development sources — it is unrelated to the upstream/downstream terminology. Option B is wrong because download mirrors are distribution infrastructure, not the upstream project itself; mirrors are downstream distribution channels. Option D is wrong because data center locations are physical infrastructure and have nothing to do with the upstream concept, which is about code provenance and maintainership.

259
Multi-Selectmedium

A student is learning about the open source movement and its impact on software development. Which two statements accurately describe the role of open source licenses in fostering collaboration? (Choose two.)

Select 2 answers
A.They mandate that all software be released under the same license, regardless of the author's choice.
B.They prohibit the distribution of modified versions to prevent fragmentation.
C.They allow users to study how the program works and modify it to suit their needs.
D.They require that all derivative works be kept secret to protect the original author's intellectual property.
E.They grant users the freedom to run the software for any purpose.
AnswersC, E

Access to source code is a cornerstone of open source licenses. It enables users to understand and modify the software, which leads to improvements and adaptations that can be shared back with the community. This freedom is essential for collaborative development, as it allows contributors to build upon each other's work and fix issues.

Why this answer

The freedom to run the software for any purpose and the freedom to study and modify it are two of the four essential freedoms that define open source software. These freedoms enable users to adapt software to their needs and contribute improvements back, which are fundamental to collaborative development. The other options describe restrictions or requirements that are not part of open source licensing principles.

Exam trap

The trap here is conflating open source with permissive licensing that allows secrecy or prohibits distribution, when in fact open source licenses guarantee freedoms that promote sharing and modification.

260
MCQeasy

How do you check the exit status of the last command executed?

A.echo $#
B.echo $!
C.echo $?
D.echo $status
AnswerC

The shell stores the previous command's exit status in the special parameter $?, so echo $? prints that numeric value. This directly satisfies the requirement to check whether the last executed command succeeded or failed.

Why this answer

In POSIX shells (bash, sh, dash), the special parameter $? expands to the exit status of the most recently executed foreground pipeline. A value of 0 conventionally indicates success, while any non-zero value (1-255) signals failure or a specific error condition. This is the standard mechanism scripts use to branch on command success, e.g., 'if [ $? -eq 0 ]; then ...'.

Exam trap

The trap here is confusing the shell's many dollar-sign special parameters — candidates who memorise '$!' as 'last something' often pick it for exit status instead of process ID.

How to eliminate wrong answers

Option A is wrong because $# expands to the number of positional parameters passed to the current shell or function, not the exit status. Option B is wrong because $! expands to the PID of the most recently backgrounded process, useful for job control but unrelated to exit codes. Option D is wrong because $status is a csh/tcsh variable, not a POSIX shell parameter; in bash it would simply expand to an empty string unless a variable of that name was explicitly set.

261
MCQeasy

A junior administrator opens a terminal in their home directory and runs the command `cd /var/log` followed by `cd ..`. Which directory are they now in?

A./var/log
B./home
C./var
D./
AnswerC

The `cd /var/log` command changes the shell's working directory to the log subdirectory, and `cd ..` refers to the parent of the current directory. Since the parent of `/var/log` is `/var`, the administrator ends up in `/var`. The `..` entry is a real directory link maintained by the filesystem in every directory, so the traversal is deterministic.

Why this answer

The shell tracks a current working directory, and `cd` modifies it. An absolute path such as `/var/log` jumps directly to that location regardless of where the user started, while the special entry `..` always denotes the parent of the current directory. Applying `..` once from `/var/log` therefore lands in `/var`, the immediate parent of the log directory.

Exam trap

The trap here is assuming `..` returns to the previous directory or the home directory, when it always means the parent of the current location.

262
Multi-Selecteasy

Which TWO of the following are considered hardware components?

Select 2 answers
A.Kernel
B.CPU
C.RAM
D.Bash
E.systemd
AnswersB, C

The CPU is a physical hardware component: a processor chip that executes instructions. It satisfies the stem's requirement for hardware, unlike software items such as operating systems or applications, which are intangible programs rather than tangible components.

Why this answer

Option B (CPU) is correct because the Central Processing Unit is a physical integrated circuit that executes instructions, making it a core hardware component of any computer. Option C (RAM) is correct because Random Access Memory is a physical memory module (e.g., DIMM) that stores data and instructions for active processes, clearly a hardware device. In contrast, option A (Kernel) is the core software layer of an operating system that manages hardware resources, not hardware itself.

Option D (Bash) is a software shell/command interpreter, and option E (systemd) is a software init and service manager; both are programs, not physical components.

Exam trap

The trap is that kernel, Bash, and systemd are all core Linux concepts that feel 'low-level' and essential, so candidates mistakenly classify them as hardware — but all three are software.

263
Multi-Selectmedium

A systems administrator is evaluating career paths within the Linux and open source ecosystem. The administrator is interested in roles that combine system operations with software development practices. Which two activities are most characteristic of a DevOps-oriented Linux role? (Choose two.)

Select 2 answers
A.Writing and maintaining infrastructure as code using tools such as Ansible, Terraform, or shell scripts to automate provisioning and configuration.
B.Avoiding version control systems and keeping configuration changes only in local notes on each administrator's workstation for speed.
C.Building and maintaining continuous integration and continuous delivery pipelines that automatically test and deploy applications to Linux servers.
D.Manually installing each server from physical installation media and configuring every service by hand to ensure unique, tailored setups.
E.Restricting all application changes to an annual release window and freezing the environment for the rest of the year to minimize risk.
AnswersA, C

Infrastructure as code is a core DevOps practice. Using tools like Ansible, Terraform, or shell scripts to define and automate provisioning and configuration lets teams reproduce environments reliably, version changes, and reduce manual drift. This activity directly blends Linux administration with software development discipline, matching the administrator's stated interest in a DevOps-oriented path.

Why this answer

DevOps-oriented Linux roles emphasize automation and collaboration between operations and development. Writing infrastructure as code and building CI/CD pipelines are two defining activities because they replace manual, inconsistent processes with versioned, repeatable automation. Manual installations, annual freezes, and avoiding version control represent traditional practices that DevOps seeks to move away from.

Exam trap

The trap here is conflating any Linux administration task with DevOps; the distinguishing factor is automation and integration with development workflows.

264
MCQeasy

A junior administrator needs to let a colleague in the accounting group read and write the shared report at /srv/reports/q3.csv, but no one outside that group should have any access. The file is currently owned by the administrator. Which command accomplishes this by changing only the group ownership to 'accounting'?

A.chmod g=accounting /srv/reports/q3.csv
B.chgrp accounting /srv/reports/q3.csv
C.usermod -g accounting /srv/reports/q3.csv
D.chown accounting /srv/reports/q3.csv
AnswerB

chgrp changes only the group owner of a file, leaving the user owner and the permission bits untouched. Pointing it at the accounting group makes the file's group category apply to accounting members, so a later chmod g+rw grants them read and write while others remain excluded. This is exactly the minimal, targeted change the scenario requires.

Why this answer

Group ownership is stored as a numeric GID in the file's inode and is changed with chgrp, or equivalently with chown using a colon separator. Using chgrp accounting changes only that metadata field, so the subsequent permission bits for the group category will apply to accounting members. Tools that edit user accounts or that only touch mode bits cannot perform this change.

Exam trap

The trap here is assuming chown with a bare name sets the group, when a single name is always treated as the new user owner.

265
MCQhard

A Linux administrator needs to grant a contractor temporary read and write access to a project directory without adding the contractor's account to a shared group or changing ownership of existing files. Which approach best meets this requirement while following standard Linux permission practice?

A.Set the directory permissions to 777 so the contractor can read and write regardless of ownership.
B.Use setfacl to add an access ACL entry granting the contractor rw on the directory and its contents.
C.Change the directory's group to the contractor's primary group and set permissions to 770.
D.Create a hard link to the directory inside the contractor's home directory.
AnswerB

Access control lists extend the traditional owner-group-other model by allowing permissions for individual named users. Adding an ACL entry for the contractor grants read and write access to the project directory without changing group membership or file ownership, and the entry can be removed when the engagement ends, satisfying the temporary requirement cleanly.

Why this answer

POSIX access control lists allow permissions to be assigned to specific named users and groups beyond the three traditional classes. Using setfacl to add an entry for the contractor grants exactly the needed read and write rights on the project directory without disturbing group membership or ownership, and the entry can later be revoked with setfacl -x to end access.

Exam trap

The trap here is reaching for chmod 777 as a quick fix for a sharing problem, which grants access to everyone rather than only the intended contractor.

266
MCQeasy

A new administrator wants to see the manual page for the `cp` command to check its options. Which command should they run?

A.info cp
B.man cp
C.doc cp
D.help cp
AnswerB

The man command displays the manual page for a given command. Running `man cp` opens the cp manual, where the administrator can read about options like -r, -p, and -i. This is the standard way to access documentation on a Linux system for commands and configuration files.

Why this answer

The man command is the standard interface to the system's manual pages. Running `man cp` displays the cp manual, covering syntax, options, and examples. Other tools like help are limited to shell built-ins, and info or custom doc commands are not universally available or standard for this purpose.

Exam trap

The trap here is assuming help works for all commands, when it only covers shell built-ins and not external binaries like cp.

267
MCQmedium

A technician needs to inspect a configuration file located at `/etc/example/app.conf` without changing the current working directory, and they want the shell prompt to keep showing their present location afterward. Which command accomplishes this?

A.cat /etc/example/app.conf
B.cd /etc/example && cat app.conf
C.less /etc/example/app.conf
D.cd /etc/example; cat app.conf; cd -
AnswerA

Passing the fully qualified path to `cat` opens and prints the file without invoking `cd`, so the shell's working directory and prompt remain exactly as they were. Absolute paths are resolved from the root of the filesystem, independent of where the user currently stands. This satisfies both the inspection goal and the requirement to leave the session location untouched.

Why this answer

Reading a file never requires the shell to relocate. Supplying the absolute path `/etc/example/app.conf` to `cat` lets the kernel resolve the file from the filesystem root while the process working directory stays unchanged. The prompt continues to report the original directory because no `cd` was executed, which is precisely the behavior the technician requested.

Exam trap

The trap here is believing a directory change is necessary before reading a file, when absolute paths let any file be accessed from anywhere.

268
MCQmedium

A developer is looking for a career that involves 'DevOps' in a Linux environment. Which skill set is most relevant for this role?

A.Writing only proprietary firmware for microcontrollers.
B.Selling commercial hardware to enterprise customers.
C.Creating graphic design assets for software GUIs.
D.Automating infrastructure deployment and managing CI/CD pipelines.
AnswerD

DevOps roles centre on automating infrastructure deployment and managing CI/CD pipelines, which is precisely the skill set the stem's DevOps career path demands. This covers provisioning, configuration management and release automation in Linux environments, rather than unrelated specialisms such as desktop support or proprietary licensing.

Why this answer

DevOps in a Linux environment centers on automating infrastructure provisioning and managing continuous integration/continuous delivery pipelines, typically using tools like Ansible, Terraform, Jenkins, GitLab CI, and Kubernetes. This skill set directly maps to the cultural and technical goals of DevOps: faster, repeatable, and reliable software delivery. The other options describe unrelated career tracks.

Exam trap

The trap is selecting a technically adjacent but non-DevOps role (like firmware or design) because the question mentions 'developer' — 010-160 tests whether you understand what DevOps actually encompasses.

How to eliminate wrong answers

Option A is wrong because writing proprietary firmware for microcontrollers is embedded systems engineering, not DevOps — it involves no CI/CD, infrastructure automation, or Linux server operations. Option B is wrong because selling commercial hardware is a sales role, not a technical DevOps position. Option C is wrong because creating graphic design assets is UI/UX or design work, unrelated to infrastructure automation or pipelines.

269
Multi-Selecthard

Which TWO statements regarding the 'umask' command are correct?

Select 2 answers
A.It can only be set by root.
B.It sets default permissions for new files.
C.It is stored in /etc/shadow.
D.It applies to existing files immediately.
E.It masks bits from being set on new files.
AnswersB, E

umask defines the permission bits withheld when a process creates files, so it establishes the default permissions applied to newly created files. This satisfies the stem's requirement by describing its effect on file creation defaults.

Why this answer

Option B is correct because umask defines the default permission bits that are removed when a new file or directory is created, so it directly sets the default permissions for new files (e.g., a umask of 022 yields 644 for files and 755 for directories). Option E is correct because umask works by masking, or clearing, permission bits from the base creation mode (666 for files, 777 for directories) so those bits are not set on newly created files. Option A is wrong because any user can set their own umask, not just root.

Option C is wrong because umask is a shell/process attribute typically set in shell profiles like /etc/profile or ~/.bashrc, not stored in /etc/shadow, which holds password hashes. Option D is wrong because umask only affects files created after it is set; it does not retroactively change permissions on existing files.

Exam trap

The 010-160 exam often tests whether candidates think umask changes existing files or is root-only, when in fact it only affects new files and can be set by any user.

270
MCQmedium

To sort the lines of a text file numerically instead of alphabetically, which flag do you use?

A.sort -n
B.sort -f
C.sort -u
D.sort -r
AnswerA

The `-n` flag makes `sort` compare lines by their leading numeric value rather than lexicographically, so "10" ranks after "9" instead of before it. This directly satisfies the stem's requirement to sort numerically rather than alphabetically, which is the default byte-order comparison.

Why this answer

The -n flag tells sort to perform a numeric sort, comparing lines by their numeric value rather than lexicographically. This is essential when sorting numbers like 2, 10, 100, which would otherwise sort as 10, 100, 2 alphabetically.

Exam trap

The trap is confusing -n (numeric) with -r (reverse) or -u (unique) — candidates who remember 'sort has a flag for numbers' may pick -r thinking 'r' stands for 'rank' or numeric ordering.

How to eliminate wrong answers

Option B is wrong because sort -f ignores case (folds lowercase to uppercase) during sorting — it is a case-insensitivity flag, not a numeric flag. Option C is wrong because sort -u removes duplicate lines (unique), which is unrelated to numeric sorting. Option D is wrong because sort -r reverses the sort order (descending instead of ascending) but still sorts lexicographically unless combined with -n.

271
MCQeasy

Which command-line tool is used to display the groups a specific user belongs to?

A.groups
B.id
C.listgroups
D.whoami
AnswerA

The `groups` command queries the system's group database and prints every group name associated with a specified user, directly satisfying the requirement to display a user's group memberships. Unlike `id`, which also reports the numeric UID and GID, `groups` outputs only group names, matching the question's specific scope.

Why this answer

The groups command prints the group memberships for a specified user (or the current user if none is given), making it the direct answer. Running 'groups alice' lists every group alice belongs to, including her primary group and any supplementary groups. It reads from /etc/group and /etc/passwd (or NSS sources like LDAP/SSSD) to resolve memberships.

Exam trap

The trap is that id also displays group information, so candidates may pick it; the exam distinguishes the purpose-built groups command from the more general id utility.

How to eliminate wrong answers

Option B is wrong because while id also shows group memberships (via 'id -Gn' or the groups= line), the question asks for the tool specifically used to display groups, and groups is the canonical, purpose-built command. Option C is wrong because listgroups is not a standard Linux command. Option D is wrong because whoami only prints the effective username of the current user and says nothing about group membership.

272
MCQhard

You want to delete a user account named 'baduser' and also remove their home directory. Which command is correct?

A.deluser --remove baduser
B.userdel -f baduser
C.userdel -r baduser
D.rm -rf /home/baduser && userdel baduser
AnswerC

The -r flag tells userdel to remove the user's home directory and mail spool alongside the account itself. This satisfies the stem's requirement to delete baduser and also remove their home directory in one command.

Why this answer

The userdel -r command removes the user account from /etc/passwd and /etc/shadow and also deletes the user's home directory and mail spool in one step. This is the standard, atomic way to fully decommission an account on Linux. Using -r ensures no orphaned home directory remains, which is important for security and disk hygiene.

Exam trap

The trap is confusing the force flag (-f) with home-directory removal (-r); candidates often pick -f thinking it cleans up everything, when it only forces deletion of the account itself.

How to eliminate wrong answers

Option A is wrong because deluser --remove is not a valid Debian syntax for removing the home directory; the correct Debian option is --remove-home (or --remove-all-files), so this command would fail or behave unexpectedly. Option B is wrong because userdel -f forces deletion even if the user is still logged in or has running processes, but it does not remove the home directory — it only removes the account entry. Option D is wrong because manually running rm -rf /home/baduser before userdel is redundant and risky; userdel -r already handles home directory removal safely, and the manual rm could delete the wrong path if the home directory is non-standard.

273
Multi-Selectmedium

Which THREE of the following represent ways to manipulate command output in a pipe?

Select 3 answers
A.grep
B.cd
C.pwd
D.wc
E.sed
AnswersA, D, E

grep filters piped input line by line, printing only lines matching a specified pattern. This is a standard way to manipulate command output within a pipeline, satisfying the stem's requirement, unlike commands that merely display or redirect output.

Why this answer

grep is correct because it filters piped input line-by-line using pattern matching and emits only matching lines to stdout, which is a classic way to manipulate command output in a pipe. wc is correct because it consumes piped input and produces counts of lines, words, and bytes (with -l, -w, -c), transforming the stream into summary output. sed is correct because it is a stream editor that reads piped input and performs non-interactive text transformations such as substitution (s/old/new/g), deletion, and printing, directly manipulating the output stream. cd is not correct because it is a shell builtin that changes the current working directory and does not read stdin or transform piped data. pwd is not correct because it simply prints the current working directory name and does not accept or manipulate piped input.

Exam trap

The trap is confusing shell builtins that produce output (pwd) with true filters; candidates may assume any command that prints text can be piped, but only stdin-consuming filters work in a pipeline.

274
MCQhard

A system administrator creates a shared directory /srv/collab and sets its permissions to 1777. Users report that they can create files but cannot delete files created by other users. Which statement describes the effect of the leading 1 in the permission mode?

A.It sets the SGID bit, causing new files to inherit the directory's group ownership.
B.It enables mandatory locking, preventing users from deleting files while they are open by another process.
C.It sets the SUID bit, allowing any user to execute files in the directory with the directory owner's privileges.
D.It sets the sticky bit, which restricts deletion of files in the directory to the file owner, the directory owner, or root.
AnswerD

The leading 1 in 1777 sets the sticky bit on the directory. On a world-writable directory, this prevents users from deleting or renaming files they do not own. Only the file owner, the directory owner, or root can remove files. This matches the reported behavior exactly.

Why this answer

The leading 1 in a numeric mode sets the sticky bit on a directory. When applied to a world-writable directory, it restricts deletion and renaming of files to the file owner, the directory owner, or root. This is exactly why users can create files but cannot delete files owned by others.

Exam trap

The trap here is confusing the sticky bit with SGID or SUID, when the leading 1 specifically sets the sticky bit on the directory.

275
MCQhard

You want to replace every occurrence of 'old' with 'new' in the file 'data.txt' and view the result in the terminal. Which command achieves this?

A.sed 's/old/new/g' data.txt
B.sed 's/old/new/' data.txt
C.grep 's/old/new/g' data.txt
D.sed 'r/old/new/g' data.txt
AnswerA

The sed substitute command with the g flag replaces every match on each line, and without -i it writes to standard output, so results appear in the terminal while data.txt stays untouched. This satisfies both the replace-all and view-in-terminal constraints.

Why this answer

The sed command with the 's/old/new/g' expression performs a global substitution, replacing every occurrence of 'old' with 'new' on each line of data.txt. By default, sed writes the modified content to standard output, which displays the result in the terminal without altering the original file. The 'g' flag is essential because without it, only the first occurrence per line would be replaced.

Exam trap

The trap is forgetting the 'g' flag — candidates often assume sed replaces all occurrences by default, but it only replaces the first match per line unless 'g' is specified.

How to eliminate wrong answers

Option B is wrong because omitting the 'g' flag means sed replaces only the first occurrence of 'old' on each line, not every occurrence as the question requires. Option C is wrong because grep is a search tool, not a substitution tool — it does not interpret 's/old/new/g' as a sed expression and would instead search for that literal pattern. Option D is wrong because 'r' is not a valid sed substitution command; the correct command is 's' for substitute, and using 'r' would cause sed to error or behave unexpectedly.

276
MCQeasy

Which file permission represents read, write, and execute for the owner, and read-only for group and others?

A.755
B.644
C.700
D.744
AnswerD

Permission 744 grants the owner read, write and execute (7), while group and others receive read only (4 each). This satisfies the stem's requirement of full owner access alongside read-only access for group and others, matching the octal digit positions for user, group and other respectively.

Why this answer

The permission 744 means the owner has read (4), write (2), and execute (1) = 7, while group and others each have read (4) only. This matches the requirement of read, write, and execute for the owner and read-only for group and others. The other options do not match this exact combination.

Exam trap

010-160 often tests whether candidates confuse the octal values for read, write, and execute, so the trap is miscomputing 744 as including execute for group/others or selecting 755 which adds execute for everyone.

How to eliminate wrong answers

Option A is wrong because 755 gives the owner 7 (rwx) but group and others get 5 (r-x), which includes execute, not read-only. Option B is wrong because 644 gives the owner 6 (rw-) without execute, and group/others 4 (r--). Option C is wrong because 700 gives the owner 7 (rwx) but group and others get 0 (no permissions), not read-only.

277
Multi-Selectmedium

Which TWO of the following tools allow you to manage disk partitions?

Select 2 answers
A.fdisk
B.parted
C.cat
D.sed
E.grep
AnswersA, B

fdisk is a command-line partition table editor that creates, deletes and modifies partitions on a disk, satisfying the requirement to manage disk partitions. It writes to the partition table via an interactive menu, supporting MBR and, on modern versions, GPT layouts.

Why this answer

fdisk (A) is a classic Linux command-line utility used to create, delete, resize, and manage disk partitions on MBR and (in recent versions) GPT disks, so it directly satisfies the requirement. parted (B) is another partition-management tool that supports both MBR and GPT partitioning schemes and can create, resize, move, and delete partitions, making it equally valid for this task. The remaining options do not manage partitions: cat (C) concatenates and displays file contents, sed (D) is a stream editor for text transformation, and grep (E) searches text for pattern matches.

Exam trap

The trap is mixing up text-processing tools (cat, sed, grep) with disk utilities — candidates who skim may select grep because it can read /proc/partitions, but reading partition info is not managing partitions.

278
MCQmedium

A junior admin is confused about the difference between software RAID and hardware RAID. Which of the following is a primary characteristic of software RAID?

A.It is managed by the OS and kernel.
B.It is always faster than hardware RAID.
C.It is configured in the BIOS.
D.It requires a dedicated controller card.
AnswerA

Software RAID is implemented entirely in the operating system kernel, which handles striping, mirroring and parity across disks without dedicated controller hardware. This OS-and-kernel management is the defining characteristic distinguishing it from hardware RAID, which offloads those operations to a dedicated controller.

Why this answer

Software RAID is implemented in the operating system kernel, which manages the RAID arrays and disk operations. This is its primary characteristic, as opposed to hardware RAID which uses a dedicated controller.

Exam trap

The trap is confusing software RAID with hardware RAID features, such as BIOS configuration or dedicated controllers, leading to wrong choices.

How to eliminate wrong answers

Option B is wrong because software RAID is generally slower than hardware RAID due to CPU overhead. Option C is wrong because software RAID is configured in the OS, not in the BIOS; hardware RAID is often configured in the BIOS or via a controller utility. Option D is wrong because software RAID does not require a dedicated controller card; it uses the existing disk controllers.

279
MCQhard

A user's account has been compromised. Which command is the most effective way to lock the user account immediately while preserving their files?

A.usermod -L jdoe
B.userdel jdoe
C.killall -u jdoe
D.chsh -s /bin/false jdoe
AnswerA

usermod -L prefixes the password hash with an exclamation mark in /etc/shadow, immediately disabling password logins while leaving the account's home directory and files untouched. This locks access without deleting data, unlike userdel, which would remove the account and its files.

Why this answer

`usermod -L jdoe` locks the account by prepending an exclamation mark (!) to the password hash in /etc/shadow, immediately preventing password-based logins while leaving the user's home directory, files, UID, and group memberships fully intact. This is the standard, reversible administrative action for a compromised account because it disables authentication without destroying data or ownership.

Exam trap

The trap here is confusing 'disabling login' with 'deleting the account' — candidates often pick `userdel` because it sounds like the strongest action, but the question explicitly requires preserving the user's files.

How to eliminate wrong answers

Option B is wrong because `userdel jdoe` deletes the account and, depending on flags, may remove or orphan the user's home directory and files, which violates the requirement to preserve files. Option C is wrong because `killall -u jdoe` only terminates running processes owned by the user; it does not disable the account, so the user can log back in immediately. Option D is wrong because `chsh -s /bin/false jdoe` changes the login shell to a non-interactive binary, which blocks interactive shell logins but does not prevent other authentication methods (e.g., SSH with a forced command, cron jobs, or services) and does not lock the password.

280
MCQhard

A shared project directory `/srv/team` is owned by user `lead` and group `team`. Team members must be able to create, edit, and delete each other's files, and every new file must automatically belong to the `team` group even when created by a user whose primary group is something else. The directory already has permissions `drwxrwx---`. Which single action accomplishes the group inheritance requirement?

A.chmod g+rwx /srv/team
B.chmod g+s /srv/team
C.chmod +t /srv/team
D.chown :team /srv/team
AnswerB

Setting the setgid bit on a directory causes newly created files and subdirectories inside it to inherit the directory's group ownership rather than the creator's primary group. Since the directory's group is already team, all new content will belong to team. This directly satisfies the requirement without altering existing permissions or ownership.

Why this answer

The setgid bit on a directory is the standard mechanism for group inheritance. Once set, the kernel assigns the directory's group to every new file and subdirectory created within it, regardless of the creator's primary group. The sticky bit addresses deletion rights, and plain permission or ownership changes do not affect inheritance, so only the setgid approach meets the requirement.

Exam trap

The trap here is confusing the sticky bit's deletion protection with setgid's group inheritance, since both are special bits applied to directories.

281
MCQeasy

A file is owned by root and has permissions 600. What happens if a regular user tries to read this file?

A.The user is prompted for a password.
B.The user can only read but not write.
C.Access is granted.
D.Access is denied.
AnswerD

Permissions 600 grant read and write access solely to the owner, root, while group and others receive no permissions. A regular user falls into the "others" category, so the kernel denies the open() call with EACCES, satisfying the stem's constraint that the requester is not the owner.

Why this answer

With permissions 600 (rw-------), only the file owner (root) has read and write access; group and other have no permissions at all. A regular user falls into the 'other' category, so the kernel denies the read attempt with EACCES (Permission denied). This is standard POSIX discretionary access control behavior — the owner bits apply only to UID 0 in this case, and no ACL or capability overrides the denial.

Exam trap

The trap here is confusing the owner's permissions with everyone's permissions — candidates forget that 600 grants nothing to group or other, and that Linux does not prompt for credentials at the filesystem layer.

How to eliminate wrong answers

Option A is wrong because Linux does not prompt for a password on file access — that behavior belongs to sudo or su, not to the read() syscall, which simply returns EACCES. Option B is wrong because the user has no read permission at all; the 600 mode grants read/write only to the owner, and the user is not the owner. Option C is wrong because access is not granted — the 'other' permission bits are zero, so the kernel blocks the open() call before any data is read.

282
Multi-Selectmedium

A technician is preparing a presentation on how Linux organizes its filesystem and wants to describe the role of the Filesystem Hierarchy Standard. Which two statements accurately describe the FHS as it applies to mainstream Linux distributions? (Choose two.)

Select 2 answers
A.It defines a common directory layout so that software and administrators can rely on predictable locations for files.
B.It guarantees that all configuration files are stored in a single directory regardless of the software package.
C.It specifies the exact kernel version that a conforming distribution must ship.
D.It requires that removable media and temporary mounts appear under directories such as /media and /mnt.
E.It mandates that every distribution use the ext4 filesystem for the root partition.
AnswersA, D

The Filesystem Hierarchy Standard specifies where categories of files belong, such as programs in /usr/bin, configuration in /etc, and variable data in /var. This predictability lets packaged software and administrators find files without guessing per-distribution conventions. It is the core purpose of the standard and applies across mainstream distributions, making this statement accurate.

Why this answer

The Filesystem Hierarchy Standard exists to make file locations predictable across distributions, covering both core system directories and conventions for mounts such as /media and /mnt. It deliberately does not dictate storage formats or kernel versions, and configuration files are not forced into one universal directory. The two accurate statements reflect its real scope: consistent layout and defined mount conventions.

Exam trap

The trap here is conflating the directory-layout standard with unrelated implementation choices such as filesystem type or kernel version.

283
MCQmedium

You need to change the ownership of a file to user 'admin'. Which command is the correct way to do this?

A.usermod admin file
B.chown admin file
C.chmod admin file
D.chgrp admin file
AnswerB

chown changes file ownership, and its syntax takes the new owner followed by the target path, so 'chown admin file' assigns user admin as owner. This satisfies the stem's requirement precisely, unlike chmod, which alters permission bits rather than ownership.

Why this answer

The `chown` (change owner) command is specifically designed to change the ownership of files and directories. Running `chown admin file` sets the user 'admin' as the owner of 'file'. This is the correct and standard tool for ownership changes on Linux.

Exam trap

The trap is confusing the three file-metadata commands — candidates mix up `chown` (owner), `chgrp` (group), and `chmod` (permissions), or mistakenly reach for `usermod`, which edits account records rather than files.

How to eliminate wrong answers

Option A is wrong because `usermod` modifies user account properties (like group membership, shell, or home directory) in `/etc/passwd` — it does not operate on file ownership at all. Option C is wrong because `chmod` changes file permissions (read/write/execute bits), not ownership — it modifies the mode, not the owner. Option D is wrong because `chgrp` changes the group ownership of a file, not the user owner — it would set the group to 'admin', not the user.

284
MCQeasy

A help desk technician receives a call from a user who complains that their Linux workstation feels sluggish. The technician wants to see a dynamic, real-time list of processes sorted by CPU usage. Which command should the technician run?

A.ps aux
B.free -h
C.top
D.uptime
AnswerC

Running top launches an interactive, continuously updating view of running processes, with the busiest processes at the top by default. It refreshes every few seconds, showing CPU, memory, and load information, which directly matches the technician's need to observe real-time CPU consumption and identify the process causing sluggishness.

Why this answer

The technician needs an interactive, continuously refreshing view of processes ranked by CPU consumption. The top utility provides exactly that, updating at a configurable interval and allowing sorting and process management. Snapshot commands like ps aux and summary commands like free and uptime do not deliver a live, sorted process list.

Exam trap

The trap here is confusing a single-moment process snapshot with a live, self-refreshing process monitor.

285
MCQhard

An administrator wants to allow a user named carol to read a file /etc/secure.conf that is owned by root:root with permissions 600, without changing the file's permissions or adding carol to the root group. Which command should the administrator use?

A.chmod 640 /etc/secure.conf
B.chown carol /etc/secure.conf
C.setfacl -m u:carol:r /etc/secure.conf
D.usermod -aG root carol
AnswerC

The setfacl command with -m u:carol:r adds an access control list entry granting carol read permission. This allows carol to read the file without altering the standard permissions or group membership. ACLs are the correct tool for granting per-user access beyond the traditional owner/group/others model.

Why this answer

Access Control Lists (ACLs) allow granting permissions to specific users or groups without modifying the standard owner/group/others permissions. The setfacl command adds an entry for carol with read access, leaving the file's mode and ownership intact. This is the appropriate method for such granular access requirements.

Exam trap

The trap here is thinking that changing the group or adding the user to a group is the only way, overlooking ACLs as a targeted solution.

286
MCQeasy

Which of the following describes the core philosophy of 'Open Source' as defined by the Open Source Initiative?

A.The source code must be available for modification and redistribution.
B.The software must be provided for free without any charge.
C.The code must be written in C or C++.
D.The software must only be used for non-profit purposes.
AnswerA

Open Source Initiative criteria require freely redistributable source code, permitting modification and derived works under the same terms. This option captures that core licence requirement, satisfying the definition's demand that source be available for modification and redistribution rather than merely free of cost.

Why this answer

The Open Source Initiative's Open Source Definition centers on the freedom to use, modify, and redistribute source code, including derivative works, without discrimination against persons, groups, or fields of endeavor. Option A captures this core requirement that source code must be available and modifiable. Free-of-charge distribution is explicitly not required — OSI-approved licenses may permit commercial sale.

Exam trap

The trap is equating 'open source' with 'free of charge' — candidates raised on the colloquial meaning of 'free software' pick option B, missing that the OSI definition is about source availability and modification rights, not price.

How to eliminate wrong answers

Option B is wrong because 'open source' does not mean 'no cost'; the OSI definition permits charging for distribution, and 'free' refers to freedom, not price (as the FSF puts it). Option C is wrong because the OSI places no restriction on programming language; licenses apply to code regardless of whether it is C, Python, Rust, or anything else. Option D is wrong because the Open Source Definition explicitly forbids discrimination against fields of endeavor, including commercial and for-profit use.

287
MCQmedium

You are managing a Linux server and need to confirm the IP address assigned to the eth0 interface. Which command is most appropriate on modern distributions?

A.ifconfig
B.ip addr
C.route -n
D.netstat -rn
AnswerB

`ip addr` queries the kernel's netlink interface directly, reading current interface state from the running system rather than a legacy configuration file. It reports eth0's assigned IPv4 and IPv6 addresses, satisfying the need to confirm the actual address on modern distributions where `ifconfig` is deprecated and often absent by default.

Why this answer

The `ip addr` command is part of the iproute2 suite, which has replaced the legacy net-tools package on modern Linux distributions. It queries the kernel's network stack directly via netlink sockets and displays all interfaces with their assigned IPv4/IPv6 addresses, MAC addresses, and link state. Running `ip addr` (or its shorthand `ip a`) shows the eth0 interface with its inet address, making it the correct modern tool for this task.

Exam trap

The trap here is familiarity bias — candidates who learned Linux from older tutorials instinctively pick ifconfig, not realizing that modern distributions (and the LPI exam) treat net-tools as deprecated in favor of iproute2.

How to eliminate wrong answers

Option A is wrong because ifconfig belongs to the deprecated net-tools package, is no longer installed by default on most modern distributions (RHEL 7+, Ubuntu 18.04+), and does not display secondary IP addresses without the :0 alias syntax. Option C is wrong because `route -n` displays the kernel routing table in numeric form, not interface IP assignments. Option D is wrong because `netstat -rn` also shows the routing table (the -r flag means routes, -n means numeric), not interface addresses.

288
MCQmedium

A Linux administrator needs to check how much free space remains on each mounted filesystem before deploying a large application. The administrator wants a quick, human-readable summary showing used and available space per mount point. Which command should be used?

A.df -h
B.fdisk -l
C.lsblk -f
D.du -sh /
AnswerA

df -h reports disk space usage for all mounted filesystems in human-readable units, showing total size, used space, and available space per mount point. This directly provides the per-filesystem summary the administrator needs before deploying an application, and it executes quickly because it reads filesystem metadata rather than scanning files.

Why this answer

df -h is the standard tool for reporting filesystem capacity and remaining space across all mount points, with sizes scaled to KiB, MiB, and GiB for readability. It reads superblock information, so it is nearly instantaneous even on large volumes. du, lsblk, and fdisk provide usage totals, device layout, or partition geometry instead of per-filesystem free space.

Exam trap

The trap here is reaching for du because it also deals with disk usage, but du measures how much space files consume rather than how much remains on a filesystem.

289
Multi-Selecthard

Which THREE of the following files/commands are involved in system startup or services?

Select 3 answers
A./etc/hosts
B./etc/init.d
C.systemd
D./proc/cpuinfo
E.init
AnswersB, C, E

/etc/init.d holds SysV init scripts that start and stop services during system startup, satisfying the question's requirement for a startup or service file. Each script accepts start, stop and restart arguments, letting the init system launch daemons at defined runlevels.

Why this answer

/etc/init.d is correct because it is the traditional SysV-style directory holding init scripts that start, stop, and restart system services, and it is directly involved in service management during startup. systemd is correct because it is the modern init system and service manager on most Linux distributions, responsible for booting the system and managing services via units. init is correct because it is the classic first process (PID 1) that initializes the system and launches services, and it remains the conceptual name for the startup process even under systemd. /etc/hosts is not correct because it is a static hostname-to-IP mapping file used for name resolution, not a startup or service component. /proc/cpuinfo is not correct because it is a virtual file exposing CPU information, unrelated to system startup or service management.

Exam trap

The trap is that candidates see /etc/hosts and /proc/cpuinfo as 'system files' and assume they relate to startup, but the exam distinguishes configuration/informational files from actual init and service mechanisms.

290
MCQeasy

A community college instructor is preparing a lesson on the origins of the Linux operating system. She wants to explain why Linux is described as a 'kernel' rather than a complete operating system, and which project provided the essential user-space tools that were combined with it. Which project supplied those foundational command-line utilities?

A.The Mozilla Foundation
B.The Apache Software Foundation
C.The XFree86 Project
D.The GNU Project
AnswerD

The GNU Project, launched by Richard Stallman in 1983, produced the shell, compiler, coreutils, and other user-space components that Linus Torvalds' kernel lacked. When combined with the Linux kernel in the early 1990s, the result was a complete, freely redistributable operating system commonly called GNU/Linux. This is why the instructor correctly identifies GNU as the source of the foundational command-line utilities.

Why this answer

Linux by itself is only a kernel: it manages hardware, processes, and memory but offers no shell, compiler, or standard utilities. The GNU Project had already built those user-space components, so merging them with the Linux kernel produced a complete operating system. This is why the community frequently refers to the combined result as GNU/Linux, and why GNU is the correct source of the foundational tools.

Exam trap

The trap here is assuming that Linux was a complete operating system from the start, rather than a kernel that needed GNU user-space tools to become usable.

291
MCQhard

An administrator needs to monitor network traffic in real-time on a specific interface. Which tool is commonly used to capture and display packets?

A.netstat
B.tcpdump
C.iptables
D.nmap
AnswerB

tcpdump captures packets directly from a chosen interface and prints them in real time, satisfying the requirement to monitor traffic live on a specific interface. It operates at the link layer via libpcap, unlike tools that only report aggregate statistics or historical logs.

Why this answer

tcpdump is the classic command-line packet capture tool that reads frames from a network interface via libpcap and displays them in real time or writes them to a pcap file. It supports BPF filter expressions to narrow captured traffic, making it ideal for live monitoring on a specific interface (e.g., tcpdump -i eth0). This matches the requirement to capture and display packets.

Exam trap

The trap is confusing network diagnostic tools: candidates may pick netstat because it also 'monitors network traffic', but netstat shows connection state, not packet contents.

How to eliminate wrong answers

Option A is wrong because netstat reports socket and connection statistics (listening ports, established connections) but does not capture or display packet contents. Option C is wrong because iptables is a packet filtering and NAT framework; it manipulates firewall rules rather than capturing and displaying traffic. Option D is wrong because nmap is a port scanner and host discovery tool; it sends probes and reports open ports/services but is not a packet capture utility.

292
MCQmedium

You are currently in '/home/user/docs' and need to move to '/etc'. Which command is correct?

A.cd ~/etc
B.cd ../../etc
C.cd /etc
D.cd etc
AnswerC

`cd /etc` uses an absolute path, so the shell resolves it from the filesystem root regardless of the current working directory. This satisfies the stem's constraint of moving from `/home/user/docs` to `/etc` in a single step, without relying on relative traversal such as `../../etc`.

Why this answer

`cd /etc` uses an absolute path (starting with /), which navigates directly to /etc regardless of the current working directory. Absolute paths are resolved from the filesystem root, so this works from anywhere. This is the correct and unambiguous way to move to /etc.

Exam trap

The trap is confusing relative and absolute paths — 010-160 tests whether you recognize that only a leading / guarantees navigation to the system root's /etc.

How to eliminate wrong answers

Option A is wrong because `cd ~/etc` expands to /home/user/etc (the etc directory inside the user's home), not the system /etc — the tilde expands to $HOME. Option B is wrong because `cd ../../etc` is a relative path that from /home/user/docs goes up two levels to /home, then into /home/etc, which does not exist. Option C is correct.

Option D is wrong because `cd etc` is a relative path looking for an 'etc' subdirectory inside the current directory (/home/user/docs/etc), which does not exist.

293
MCQmedium

A user wants to find all files in the /var/log directory that have been modified in the last 24 hours and display their names. Which command accomplishes this?

A.ls -l /var/log | grep '24'
B.find /var/log -name '*.log' -newer /tmp/timestamp
C.find /var/log -type f -mtime -1
D.grep -r '24' /var/log
AnswerC

The find command with -type f limits the search to regular files, and -mtime -1 selects files modified less than 24 hours ago. This directly matches the requirement to find files modified in the last day and list their names.

Why this answer

The find command is the standard tool for searching files based on metadata such as modification time. Using -mtime -1 correctly selects files modified within the last 24 hours, and -type f restricts to regular files. Other commands like ls with grep, find with -newer, or grep -r do not accurately or completely fulfill the task.

Exam trap

The trap here is thinking that listing directory contents with ls and filtering with grep can reliably find files modified within a specific time frame.

294
Multi-Selecthard

Which THREE of the following are types of manual page sections?

Select 3 answers
A.Network protocols (10)
B.User commands (1)
C.System calls (2)
D.File formats (5)
E.Kernel hardware (20)
AnswersB, C, D

User commands is a manual page section type, documenting commands a user can run. It sits alongside name, synopsis, description, options, files, see also and author sections, satisfying the question's request for a genuine manual page section category.

Why this answer

The Linux manual pages are organized into numbered sections, and the three options marked correct are genuine section types: B 'User commands (1)' is section 1, which documents executable programs and shell commands users can run; C 'System calls (2)' is section 2, which documents the kernel system-call interface used by programs such as open(2) and read(2); and D 'File formats (5)' is section 5, which documents file formats and conventions such as /etc/passwd(5) and proc(5). The unmarked options do not belong: A 'Network protocols (10)' is not a manual section (section 10 does not exist in the standard man-pages layout), and E 'Kernel hardware (20)' is not a manual section either (section 20 is not a standard section; hardware-related pages typically appear in section 4, 'Devices and special files').

Exam trap

The trap here is that candidates may assume any numbered category is a valid man section, but only sections 1-9 exist; options like '10' or '20' are fabricated to test whether you know the actual section numbering scheme.

295
MCQmedium

A user needs to find all files in the /var/log directory that have been modified in the last 24 hours. Which command will accomplish this?

A.find /var/log -mtime -1
B.ls -l /var/log
C.find /var/log -mtime +1
D.grep -r "24 hours" /var/log
AnswerA

The find command with -mtime -1 matches files modified less than 24 hours ago. The -1 means less than one day. This directly satisfies the requirement to locate recently modified files in /var/log, making it the correct choice.

Why this answer

find is designed to search for files based on various criteria, including modification time. The -mtime option takes a number of days; a negative value like -1 selects files modified less than that many days ago. Thus, find /var/log -mtime -1 correctly identifies files changed within the last 24 hours.

Exam trap

The trap here is reversing the meaning of -mtime -1 and +1; the minus sign means less than, not more than.

296
Multi-Selectmedium

A Linux user wants to create a new directory named 'projects' and then move an existing file named 'report.txt' into it. Which two commands will accomplish these tasks? (Choose two.)

Select 2 answers
A.rm report.txt projects/
B.touch projects
C.mv report.txt projects/
D.cp report.txt projects/
E.mkdir projects
AnswersC, E

The mv command moves or renames files. Using 'mv report.txt projects/' moves the file 'report.txt' into the 'projects' directory, assuming that directory exists. This accomplishes the second task. The trailing slash is optional but clarifies that 'projects' is a directory, preventing accidental renaming if a file with that name existed.

Why this answer

Creating a directory requires mkdir, and moving a file into it requires mv. The combination of mkdir projects and mv report.txt projects/ achieves both goals. Copying leaves the original in place, touch creates a file instead of a directory, and rm deletes rather than moves.

Exam trap

The trap here is confusing copy with move, or using touch to create a directory, when each command has a distinct purpose.

297
MCQmedium

A junior administrator needs to display the full contents of /etc/hostname and also see line numbers next to each line. Which command accomplishes this?

A.wc -l /etc/hostname
B.cat -n /etc/hostname
C.less -N /etc/hostname
D.head -n /etc/hostname
AnswerB

The cat utility with the -n option numbers every output line, including blank ones, before printing the file. Running cat -n /etc/hostname therefore shows the full contents with a line number prefix, which is exactly what the administrator requested, and it works without invoking a pager or editor.

Why this answer

The cat command copies file contents to standard output, and its -n option prepends a line number to every line, including empty ones. That combination displays the entire file with numbering in a single non-interactive command. The alternatives either misuse an option, open an interactive pager, or merely count lines instead of showing the content.

Exam trap

The trap here is assuming that any command with an 'n' option produces line numbers, when in fact head and wc use that letter for a count or a line count respectively.

298
Multi-Selectmedium

Which THREE commands are used to manage user account lifecycle?

Select 3 answers
A.passwd
B.groupadd
C.useradd
D.userdel
E.usermod
AnswersC, D, E

useradd creates a new account, writing the entry to /etc/passwd and /etc/shadow. It is the creation stage of the account lifecycle, complementing modification and deletion commands to cover the full span the question asks for.

Why this answer

The three commands that manage the user account lifecycle are useradd (C), userdel (D), and usermod (E). useradd creates a new user account, including its entry in /etc/passwd, /etc/shadow, and /etc/group, and optionally provisions a home directory and default shell, which is the creation phase of the lifecycle. userdel removes a user account and, with options like -r, also deletes the home directory and mail spool, covering the deletion phase. usermod modifies an existing account's attributes such as login name (-l), UID (-u), shell (-s), groups (-aG), and account expiry, covering the maintenance/modification phase. passwd (A) only changes or manages a user's password and password aging, and groupadd (B) only creates groups, so neither manages the full user account lifecycle of create, modify, and delete.

Exam trap

The trap is including passwd or groupadd because they 'feel' related to accounts — but the exam specifically wants the create/modify/delete trio, and passwd/groupadd do not perform lifecycle operations on user accounts.

299
Multi-Selectmedium

A junior Linux administrator is exploring ways to participate in the open source community beyond simply using the software. Which two activities represent direct contributions to an open source project? (Choose two.)

Select 2 answers
A.Recommending the software to colleagues who are looking for alternatives
B.Reading the project's release notes to learn about new features
C.Writing or updating documentation that explains how to install and configure the software
D.Submitting a patch or pull request that fixes a bug in the project's source code
E.Installing the software on a personal laptop and using it for daily tasks
AnswersC, D

Documentation contributions are direct project contributions. Good documentation lowers the barrier for new users and reduces support burden, and maintainers frequently accept documentation patches through the same review process as code. Updating installation and configuration guides is a recognized, valuable way to participate in an open source project's ongoing development.

Why this answer

Direct contributions are artifacts submitted back to a project: code patches, documentation updates, translations, bug reports with reproductions, and testing feedback. Submitting a patch or pull request and writing or updating documentation both produce reviewable artifacts that maintainers can merge. Personal use, reading release notes, and recommending the software are consumption or advocacy activities that do not add anything to the project itself.

Exam trap

The trap here is counting any involvement with open source software, such as using it or recommending it, as a contribution, when a contribution must produce something the project can incorporate.

300
MCQmedium

You are copying a directory named 'source' to 'destination' and want to ensure all subdirectories and file attributes are preserved. Which flag is essential?

A.cp -a
B.cp -p
C.cp -v
D.cp -r
AnswerA

The `-a` flag combines `-R`, `-p` and `-d`, recursively copying while preserving permissions, ownership, timestamps and symbolic links. This directly satisfies the stem's requirement that all subdirectories and file attributes survive the copy, which a plain `cp -R` would not guarantee.

Why this answer

The `-a` (archive) flag is a combination of `-dR --preserve=all`, which recursively copies directories while preserving symbolic links, file permissions, ownership, timestamps, and extended attributes. This makes it the only option that ensures all subdirectories and file attributes are preserved in a single command. While `-p` preserves some attributes, it does not recurse into subdirectories, and `-r` recurses but does not preserve attributes.

Therefore, `cp -a` is essential for a complete archive copy.

Exam trap

The trap here is confusing `-p` with `-a`: candidates often think `-p` preserves all attributes, but it does not recurse, and `-r` alone does not preserve attributes, so only `-a` satisfies both requirements.

How to eliminate wrong answers

Option B is wrong because `cp -p` preserves mode, ownership, and timestamps but does not copy directories recursively, so subdirectories would be omitted. Option C is wrong because `cp -v` only enables verbose output, showing files as they are copied, but does not preserve attributes or ensure recursion. Option D is wrong because `cp -r` copies directories recursively but does not preserve file attributes such as permissions, ownership, or timestamps, making it insufficient for the requirement.

Page 3

Page 4 of 5

Page 5

All pages