Home / LPIC-1 Linux Administrator (101-500 / 102-500) / Mock exam
LPIC-1 Linux Administrator (101-500 / 102-500) Exam-style mock test

LPIC-1 Linux Administrator (101-500 / 102-500)|Practice test

Full explanations Exam format Pass line 70%
33 USD One-time · lifetime access
Enroll →

Sample questions

Example1 · System Architecture
A technician at a small web hosting shop needs to confirm that the e1000e network driver is currently loaded into the running kernel before swapping a NIC. Which command lists the modules the kernel has loaded right now?
・Run insmod to insert the module file into the kernel
Incorrect. insmod inserts a single module file into the kernel; it does not produce a listing of modules already loaded.
・Run modinfo e1000e for its metadata
Incorrect. modinfo displays metadata about a module file; it cannot enumerate the modules the kernel has loaded.
✓Run lsmod to list the loaded modules
Correct. lsmod reads /proc/modules and prints the currently loaded modules along with their size and use count.
・Run depmod -a to rebuild the module dependency map
Incorrect. depmod rebuilds the modules.dep dependency database; it does not report which modules are loaded.
Explanation
lsmod is the standard way to see modules currently in the kernel, formatting the contents of /proc/modules. insmod, modinfo, and depmod serve loading, inspection, and dependency-building roles respectively.
Example2 · Linux Installation and Package Management
A small web hosting shop is partitioning a new server that boots in legacy BIOS mode with GRUB 2. The admin wants a dedicated partition to keep kernel and initrd images isolated from the root filesystem. Which mount point should that separate partition use?
・Mount it at /srv for website content
Incorrect. The /srv tree is intended for data served by the system, such as website or FTP content, not kernel images.
✓Mount it at /boot so it holds kernels
Correct. The /boot partition holds the kernel images, initrd, and GRUB stage files so they stay separate from the root filesystem.
・Mount it at /var for logs and spool data
Incorrect. The /var hierarchy stores variable data like logs and spool files, and is unrelated to booting.
・Mount it at /opt for add-on application trees
Incorrect. The /opt directory is reserved for add-on application packages, not for kernel and initrd files.
Explanation
A dedicated /boot partition keeps the kernel, initrd, and bootloader files in one isolated location, which simplifies encryption or filesystem choices for the root filesystem. The other listed mount points serve application data, served content, or variable data.
Example3 · GNU and Unix Commands
A technician at a small web hosting shop wants the shell to treat the literal string $HOME as plain text when echoing a reminder, so no variable expansion happens. Which quoting style around the string prevents the shell from expanding it?
・Enclosing the string within double quotes as shown
Incorrect. Double quotes still allow variable and command substitution, so $HOME would expand to the path.
✓Enclosing the string in single quotes, as in 'echo $HOME'
Correct. Single quotes preserve every character literally, so $HOME is printed verbatim without expansion.
・Preceding the string with a plain backslash on every word in it
Incorrect. A backslash only escapes the single character that immediately follows it, not whole words.
・Wrapping the whole string in backticks to run it as a subshell
Incorrect. Backticks perform command substitution and run the enclosed text as a command instead.
Explanation
Single quotes are the strongest form of bash quoting and suppress all expansion and substitution. Double quotes still permit $variable, backtick, and $(...) expansion. Backslash escapes only the next single character.
Example4 · Devices, Linux Filesystems, FHS
A datacenter operator provisions a new 50 GB block device at /dev/sdc that will hold an ext4 filesystem reserving 128-byte inodes every 8 KiB. Which command builds that filesystem on the raw device?
・mkswap /dev/sdc for the device
Incorrect. mkswap initializes a swap area, not an ext4 data filesystem for storing files.
・mke2fs -t vfat /dev/sdc as a FAT layout
Incorrect. The -t vfat flag tells mke2fs to build a FAT layout, which is not ext4 and conflicts with the ext tooling.
・fsck.ext4 -f /dev/sdc to check it
Incorrect. fsck.ext4 only checks and repairs an existing ext4 filesystem; it does not create one.
✓mkfs.ext4 /dev/sdc to build the filesystem
Correct. mkfs.ext4 writes an ext4 filesystem directly onto the specified block device.
Explanation
The mkfs.ext4 helper (an alias for mke2fs -t ext4) formats a block device with the ext4 filesystem. Tools such as mkswap, fsck, and FAT formatting serve entirely different purposes.
Example5 · Shells and Shell Scripting; User Interfaces
A fintech backend engineer wants an environment variable exported in a Bash script so that any child process it spawns inherits the value. Inside the script, which statement both assigns and exports the variable REGION in one line?
・setenv REGION ap-northeast-1 for the current shell environment
Incorrect. The setenv syntax belongs to csh/tcsh, not Bash, so this line fails in a Bash script.
✓export REGION=ap-northeast-1 within the Bash script
Correct. In Bash, export REGION=ap-northeast-1 assigns the value and marks it for inheritance by child processes in a single statement.
・REGION := ap-northeast-1 inside the running shell
Incorrect. The := operator and that phrasing are not Bash assignment syntax, and no export marking is performed at all.
・let REGION=ap-northeast-1 then try to share it
Incorrect. The let builtin only evaluates arithmetic expressions and does not export the resulting shell variable.
Explanation
Bash combines assignment and exporting with export NAME=value. The csh-family setenv and the arithmetic let builtin do not export variables for child-process inheritance.
Example6 · Administrative Tasks and Essential System Services
A fintech backend engineer provisions a service account and needs it created with its home directory populated from the template directory. Which single invocation adds the account named svc_batch and ensures its home is built from the skeleton files?
・useradd -M -s /bin/bash svc_batch suppressing the home
Incorrect. The -M flag here explicitly suppresses home directory creation, so no skeleton files are copied at all.
✓useradd -m svc_batch populating the home directory
Correct. The -m flag creates the home directory and populates it with the contents of /etc/skel for the new account.
・useradd -r -M svc_batch as system
Incorrect. This requests a system account and -M disables home creation, the opposite of populating from the skeleton.
・useradd -D -g staff svc_batch
Incorrect. With -D and a name, useradd does not create a user; -D only displays or changes the default new-account settings.
Explanation
The -m option is what triggers copying of /etc/skel into the new user's home directory. -M suppresses it, and -D operates only on defaults.
Example7 · Networking Fundamentals
A field technician provisioning a fleet of IoT gateways needs the kernel routing table printed so the default gateway each unit received over DHCP can be confirmed. Using the modern iproute2 toolset, which command displays that table?
・ip addr flush dev eth0 on each unit
Incorrect. 'ip addr flush dev eth0' removes all addresses from eth0 rather than displaying any routing information at all.
・ip neigh replace the gateway entry
Incorrect. 'ip neigh replace' manipulates the neighbor (ARP) cache, so it edits link-layer state instead of showing routes.
✓ip route show on the unit
Correct. 'ip route show' (optionally with extra words ignored here) prints the kernel IPv4 routing table including the default gateway entry.
・ss --listening --tcp --numeric please
Incorrect. 'ss --listening --tcp --numeric' lists listening TCP sockets, which has nothing to do with the routing table.
Explanation
The iproute2 'ip route show' command reads out the kernel routing table so administrators can verify the default gateway and other routes. Commands that flush addresses, alter routes, or inspect sockets do not display the routing table.
Example8 · Security
During a fleet audit of IoT gateways, you must enumerate every file on the root filesystem that runs with the owner's privileges via the setuid bit, skipping other permission schemes. Which find invocation lists exactly those files?
✓find / -perm -4000 -type f
Correct. The symbolic value 4000 is the setuid bit; -perm -4000 matches files where that bit is set regardless of the rest of the mode.
・find / -perm -2000 -type f -print
Incorrect. The octal 2000 selects the setgid bit, which grants the group's privileges, not the owner's.
・find / -perm -1000 -type f -print
Incorrect. The value 1000 is the sticky bit, which affects directory deletion semantics and is unrelated to privilege elevation.
・find / -perm /u+s,g+s -type f -ls -print
Incorrect. Combining u+s and g+s matches both setuid and setgid files, so setgid entries would be wrongly included in the report.
Explanation
The setuid bit has the octal value 4000, so find / -perm -4000 -type f returns files that execute with the file owner's identity. Setgid (2000) and the sticky bit (1000) address different concerns, and combining u+s with g+s widens the match beyond the requested setuid-only scope.
Example9 · System Architecture
A technician servicing a rack of edge gateways needs to list the kernel modules currently loaded on one node, together with their size and the count of other modules that depend on each. Which command prints exactly this information?
・Run modinfo, which reports the author, license, and parameters stored inside one module file.
Incorrect. modinfo displays metadata such as author, license, and parameters for a single module file, not the live list of loaded modules.
・Run depmod -a, which rebuilds the modules.dep database describing how modules depend on each other.
Incorrect. depmod -a rebuilds the modules.dep dependency database and produces no listing of what is currently loaded.
✓Run lsmod, which reads the /proc/modules file and prints each loaded module with its memory size and the count of dependent modules.
Correct. lsmod reads /proc/modules and prints each loaded module with its size and the number of modules that use it.
・Run modprobe --show-depends on the module to list the chain required before insertion.
Incorrect. modprobe --show-depends resolves the dependency chain needed to insert one named module rather than reporting the running module set.
Explanation
lsmod is the standard tool for viewing loaded modules; it is essentially a formatted view of /proc/modules. modinfo, depmod, and modprobe all operate on module files or dependencies rather than reporting the currently loaded set with usage counts.
Example10 · System Architecture
On an HPC compute node, an SRE wants to confirm that the ixgbe NIC driver is already loaded into the running kernel before scheduling a bandwidth-heavy job. Which command reports the modules currently loaded?
・modinfo ixgbe to show the module file metadata
Incorrect. modinfo ixgbe prints metadata such as author and parameters from the module file but never says whether it is currently loaded.
・depmod -a to rebuild the module dependency database
Incorrect. depmod -a rebuilds the modules.dep dependency database and does not list what is loaded right now.
✓lsmod to list loaded modules
Correct. lsmod reads /proc/modules and prints the modules presently loaded in the running kernel, which confirms ixgbe is active.
・modprobe --show-depends ixgbe to list insertion ordering
Incorrect. modprobe --show-depends ixgbe only lists the dependency insertion order rather than reporting the live loaded set.
Explanation
lsmod summarizes /proc/modules, showing each loaded module with its size and use count. modinfo, depmod, and modprobe inspect or manipulate module files and dependencies rather than reporting the live loaded state.
Example11 · System Architecture
While triaging a flaky GPU on a research cluster, an engineer wants PCI devices listed with their vendor and device identifiers shown in raw numeric hex form rather than resolved names. Which invocation does this?
・lspci -k to show the kernel drivers in use
Incorrect. lspci -k shows the kernel driver and modules in use for each device, not the numeric vendor and device IDs.
・lsusb -v to dump verbose USB bus descriptors
Incorrect. lsusb -v dumps verbose details for USB devices, which is the wrong bus for a PCI-attached GPU.
✓lspci -nn to append the numeric hex identifiers
Correct. lspci -nn prints the description plus the numeric [vendor:device] hex identifiers for each PCI device.
・lspci -t to draw the tree
Incorrect. lspci -t draws a tree of the bus topology but does not emit the numeric identifiers being requested.
Explanation
The -nn flag tells lspci to append numeric vendor:device codes in brackets, useful when matching against driver databases. The -k, -t, and lsusb options report drivers, topology, or the USB bus instead.
Example12 · System Architecture
A technician at a municipal records office needs to confirm that the e1000e network driver is currently loaded into the running kernel before troubleshooting an interface. Which command lists the kernel modules that are presently active in memory?
✓Run lsmod to view the loaded modules
Correct. lsmod reads /proc/modules and displays every kernel module that is currently loaded, with its size and dependency usage count.
・Run modinfo to inspect a single module file
Incorrect. modinfo prints metadata and parameters for a single named module file, not the set of modules currently resident in the kernel.
・Run insmod --list for modules
Incorrect. insmod loads one module file directly and offers no --list mode for enumerating the modules that are active.
・Run depmod --all to dump the active modules
Incorrect. depmod rebuilds the modules.dep dependency database and never reports which modules happen to be loaded right now.
Explanation
lsmod is the standard tool for viewing loaded kernel modules and is effectively a formatted view of /proc/modules. modinfo inspects a module's attributes, insmod inserts a module, and depmod maintains dependency metadata.
Example13 · System Architecture
On a hospital imaging workstation, an administrator must inspect the IRQ numbers that peripheral hardware has been assigned by the running kernel. Which pseudo-file should be read to view the current interrupt assignments per CPU?
・Read the port map at /proc/ioports
Incorrect. /proc/ioports shows the reserved I/O port address ranges on the system, not the interrupt request line assignments.
✓Read the file at /proc/interrupts
Correct. /proc/interrupts lists each IRQ line, the interrupt count per CPU core, the controller, and the device or driver that handles it.
・Read the directory /sys/kernel/irq
Incorrect. /sys/kernel/irq is not the canonical file for this task, since interrupt counts are exposed through /proc/interrupts.
・Read the table at /proc/dma
Incorrect. /proc/dma reports the usage of DMA channels on the machine rather than any of the IRQ assignments.
Explanation
/proc/interrupts is the kernel-maintained view of IRQ usage broken down by CPU. The related /proc/ioports and /proc/dma expose other hardware resources (I/O ports and DMA channels respectively).
Example14 · System Architecture
A render-farm node loads the GPU encoding module with a required parameter. Which command inserts the kernel module nvenc into the running kernel while resolving and loading any modules it depends on first?
・insmod nvenc for one object file
Incorrect. insmod loads only one named object file and fails if that module needs others, because it never walks the dependency chain.
・depmod -a nvenc to rebuild the dependency map file
Incorrect. depmod rebuilds the modules.dep dependency database; it analyzes modules but does not load any module into the kernel.
✓modprobe nvenc to pull in the dependencies
Correct. modprobe reads the modules.dep map and loads every prerequisite module before inserting nvenc itself into the kernel.
・lsmod --insert nvenc directly into the running live kernel
Incorrect. lsmod lists modules that are already loaded and has no insert option, so it cannot bring a new module into the kernel.
Explanation
modprobe is the dependency-aware loader that consults modules.dep, whereas insmod handles only one isolated object. depmod maintains the dependency file and lsmod merely reports loaded modules.
Example15 · System Architecture
An operator on an e-commerce database host must identify which PCI slot holds the RAID controller and see its vendor and device IDs. Which command displays all devices attached to the PCI buses?
・lsusb to walk the Universal Serial Bus tree
Incorrect. lsusb enumerates devices on the Universal Serial Bus controllers, not adapters sitting on the PCI buses.
・lsblk to show each block device and partition
Incorrect. lsblk lists block storage devices and their partitions, so it will not reveal the PCI slot of the controller card.
✓lspci to list every device present on the system's PCI bus
Correct. lspci reads from the PCI bus and lists each PCI device along with its vendor and device identifiers.
・lsdev to summarize IRQ, DMA, and I/O port usage
Incorrect. lsdev summarizes IRQ, DMA, and I/O port usage from /proc files rather than enumerating PCI bus devices directly.
Explanation
lspci is the dedicated tool for inspecting PCI-attached hardware such as RAID controllers. lsusb covers USB, lsblk covers block devices, and lsdev reports resource allocations.
▶ Try 10 free questions (graded)
Measure your readiness with a full mock exam
All questions · full explanations · lifetime access
Enroll(33 USD)