PRACTICE EXAM: 2026 LPIC-2 LINUX ENGINEER
Hard-Level Multiple-Choice Questions with
Detailed Rationales
1. Which command displays the current kernel ring buffer messages?
A) dmesg
B) journalctl -k
C) cat /proc/kmsg
D) All of the above
Answer: D) All of the above
Rationale: dmesg reads the kernel ring buffer directly. journalctl -k displays kernel messages from the
systemd journal. cat /proc/kmsg reads the kernel message log. All three provide access to kernel
messages, though with different interfaces.
2. What is the purpose of the /etc/ld.so.conf file?
A) To configure dynamic linker search paths
B) To configure library dependencies
C) To configure static library links
D) To configure shared library versions
Answer: A) To configure dynamic linker search paths
Rationale: /etc/ld.so.conf contains directories to be searched by the dynamic linker for shared libraries.
After modifying this file, ldconfig must be run to update the library cache (/etc/ld.so.cache).
3. Which command is used to create and manage software RAID arrays?
A) mdadm
B) raidtools
C) dmraid
D) Both A and B
Answer: D) Both A and B
Rationale: mdadm is the modern tool for managing software RAID in Linux. raidtools is the legacy
toolset. Both can create and manage RAID arrays. dmraid is used for hardware RAID detection.
4. What is the purpose of the 'strace' command?
A) To trace system calls and signals
B) To trace network connections
,C) To trace file system operations
D) To trace process execution
Answer: A) To trace system calls and signals
Rationale: strace intercepts and records system calls made by a process. It's invaluable for debugging
application issues, identifying configuration problems, and understanding how programs interact with
the kernel.
5. Which file contains the configuration for the NTP daemon?
A) /etc/ntp.conf
B) /etc/chrony.conf
C) /etc/ntp/ntp.conf
D) Both A and B
Answer: D) Both A and B
Rationale: /etc/ntp.conf is the default configuration file for ntpd. /etc/chrony.conf is used by chrony, an
alternative NTP implementation. Both serve the same purpose of configuring time synchronization.
6. What does the 'lvcreate' command do?
A) Creates a logical volume
B) Creates a physical volume
C) Creates a volume group
D) Creates a file system
Answer: A) Creates a logical volume
Rationale: lvcreate creates logical volumes within volume groups. It's part of the LVM (Logical Volume
Manager) suite. pvcreate creates physical volumes, and vgcreate creates volume groups.
7. Which command displays information about all logical volumes?
A) lvdisplay
B) lvs
C) Both A and B
D) vgdisplay
Answer: C) Both A and B
Rationale: lvdisplay provides detailed information about logical volumes. lvs shows a concise summary of
logical volumes. Both commands provide LV information, with lvs being more compact and script-
friendly.
8. What is the purpose of the 'rsync --delete' option?
A) To delete files on the destination not present in source
B) To delete files on the source after transfer
, C) To delete empty directories
D) To delete symbolic links
Answer: A) To delete files on the destination not present in source
Rationale: --delete removes files from the destination that are not present in the source directory. This
makes the destination a mirror of the source, ensuring exact synchronization of the directory contents.
9. Which command is used to configure network interfaces on a Debian system?
A) /etc/network/interfaces
B) /etc/sysconfig/network-scripts/ifcfg-*
C) /etc/NetworkManager/system-connections/
D) nmcli
Answer: A) /etc/network/interfaces
Rationale: Debian systems use /etc/network/interfaces for network configuration. Red Hat systems use
/etc/sysconfig/network-scripts/ifcfg- files. NetworkManager configurations are stored in
/etc/NetworkManager/system-connections/.*
10. What is the function of the 'ip route add' command?
A) To add a route to the routing table
B) To add a network interface
C) To add an IP address
D) To add a default gateway
Answer: A) To add a route to the routing table
Rationale: 'ip route add' adds entries to the kernel routing table. It's used to configure static routes,
default gateways, and network routes in modern Linux systems using the iproute2 suite.
11. Which file contains the definition of system services in System V init?
A) /etc/inittab
B) /etc/init.d/
C) /etc/rc.d/
D) /etc/systemd/system/
Answer: B) /etc/init.d/
Rationale: /etc/init.d/ contains the init scripts for System V init systems. These scripts are used to start,
stop, and manage services. /etc/rc.d/ is used on some systems, and /etc/systemd/system/ is for systemd
units.
12. What is the purpose of the 'systemctl enable' command?
A) To enable a service to start at boot
B) To start a service immediately
Hard-Level Multiple-Choice Questions with
Detailed Rationales
1. Which command displays the current kernel ring buffer messages?
A) dmesg
B) journalctl -k
C) cat /proc/kmsg
D) All of the above
Answer: D) All of the above
Rationale: dmesg reads the kernel ring buffer directly. journalctl -k displays kernel messages from the
systemd journal. cat /proc/kmsg reads the kernel message log. All three provide access to kernel
messages, though with different interfaces.
2. What is the purpose of the /etc/ld.so.conf file?
A) To configure dynamic linker search paths
B) To configure library dependencies
C) To configure static library links
D) To configure shared library versions
Answer: A) To configure dynamic linker search paths
Rationale: /etc/ld.so.conf contains directories to be searched by the dynamic linker for shared libraries.
After modifying this file, ldconfig must be run to update the library cache (/etc/ld.so.cache).
3. Which command is used to create and manage software RAID arrays?
A) mdadm
B) raidtools
C) dmraid
D) Both A and B
Answer: D) Both A and B
Rationale: mdadm is the modern tool for managing software RAID in Linux. raidtools is the legacy
toolset. Both can create and manage RAID arrays. dmraid is used for hardware RAID detection.
4. What is the purpose of the 'strace' command?
A) To trace system calls and signals
B) To trace network connections
,C) To trace file system operations
D) To trace process execution
Answer: A) To trace system calls and signals
Rationale: strace intercepts and records system calls made by a process. It's invaluable for debugging
application issues, identifying configuration problems, and understanding how programs interact with
the kernel.
5. Which file contains the configuration for the NTP daemon?
A) /etc/ntp.conf
B) /etc/chrony.conf
C) /etc/ntp/ntp.conf
D) Both A and B
Answer: D) Both A and B
Rationale: /etc/ntp.conf is the default configuration file for ntpd. /etc/chrony.conf is used by chrony, an
alternative NTP implementation. Both serve the same purpose of configuring time synchronization.
6. What does the 'lvcreate' command do?
A) Creates a logical volume
B) Creates a physical volume
C) Creates a volume group
D) Creates a file system
Answer: A) Creates a logical volume
Rationale: lvcreate creates logical volumes within volume groups. It's part of the LVM (Logical Volume
Manager) suite. pvcreate creates physical volumes, and vgcreate creates volume groups.
7. Which command displays information about all logical volumes?
A) lvdisplay
B) lvs
C) Both A and B
D) vgdisplay
Answer: C) Both A and B
Rationale: lvdisplay provides detailed information about logical volumes. lvs shows a concise summary of
logical volumes. Both commands provide LV information, with lvs being more compact and script-
friendly.
8. What is the purpose of the 'rsync --delete' option?
A) To delete files on the destination not present in source
B) To delete files on the source after transfer
, C) To delete empty directories
D) To delete symbolic links
Answer: A) To delete files on the destination not present in source
Rationale: --delete removes files from the destination that are not present in the source directory. This
makes the destination a mirror of the source, ensuring exact synchronization of the directory contents.
9. Which command is used to configure network interfaces on a Debian system?
A) /etc/network/interfaces
B) /etc/sysconfig/network-scripts/ifcfg-*
C) /etc/NetworkManager/system-connections/
D) nmcli
Answer: A) /etc/network/interfaces
Rationale: Debian systems use /etc/network/interfaces for network configuration. Red Hat systems use
/etc/sysconfig/network-scripts/ifcfg- files. NetworkManager configurations are stored in
/etc/NetworkManager/system-connections/.*
10. What is the function of the 'ip route add' command?
A) To add a route to the routing table
B) To add a network interface
C) To add an IP address
D) To add a default gateway
Answer: A) To add a route to the routing table
Rationale: 'ip route add' adds entries to the kernel routing table. It's used to configure static routes,
default gateways, and network routes in modern Linux systems using the iproute2 suite.
11. Which file contains the definition of system services in System V init?
A) /etc/inittab
B) /etc/init.d/
C) /etc/rc.d/
D) /etc/systemd/system/
Answer: B) /etc/init.d/
Rationale: /etc/init.d/ contains the init scripts for System V init systems. These scripts are used to start,
stop, and manage services. /etc/rc.d/ is used on some systems, and /etc/systemd/system/ is for systemd
units.
12. What is the purpose of the 'systemctl enable' command?
A) To enable a service to start at boot
B) To start a service immediately